kohler / hotcrp

HotCRP conference review software
http://read.seas.harvard.edu/~kohler/hotcrp
Other
328 stars 111 forks source link

Warnings (Session cannot be started after headers have already been sent) when turn on oauth #340

Closed xcompass closed 6 months ago

xcompass commented 6 months ago

When enabling oauth, the warnings (shown below) will show up in the sign in section.

Screenshot 2024-03-13 at 11 23 41 PM

I inserted a debug_print_backtrace() to print out the stacktrace:

<b>Warning</b>:  session_start(): Session cannot be started after headers have already been sent in <b>/var/www/html/lib/phpqsession.php</b> on line <b>10</b><br />
--
  | #0 /var/www/html/lib/qsession.php(54): PHPQsession->start(NULL)
  | #1 /var/www/html/lib/qsession.php(23): Qsession->handle_open()
  | #2 /var/www/html/lib/qrequest.php(766): Qsession->open()
  | #3 /var/www/html/src/conference.php(3507): Qrequest->post_value()
  | #4 /var/www/html/src/pages/p_signin.php(268): Conf->hoturl('oauth', Array)
  | #5 /var/www/html/src/componentset.php(279): Signin_Page::print_signin_form_oauth(Object(Contact), Object(Qrequest), Object(ComponentSet), Object(stdClass))
  | #6 /var/www/html/src/componentset.php(497): ComponentSet->call_function(Object(stdClass), 'Signin_Page::pr...', Object(stdClass))
  | #7 /var/www/html/src/componentset.php(484): ComponentSet->_print_body(Object(stdClass), false)
  | #8 /var/www/html/src/componentset.php(541): ComponentSet->print(Object(stdClass))
  | #9 /var/www/html/src/pages/p_signin.php(166): ComponentSet->print_members('signin/form')
  | #10 /var/www/html/src/pages/p_home.php(191): Signin_Page::print_signin_form(Object(Contact), Object(Qrequest), Object(ComponentSet))
  | #11 /var/www/html/src/componentset.php(279): Home_Page->print_signin(Object(Contact), Object(Qrequest), Object(ComponentSet), Object(stdClass))
  | #12 /var/www/html/src/componentset.php(497): ComponentSet->call_function(Object(stdClass), Array, Object(stdClass))
  | #13 /var/www/html/src/componentset.php(484): ComponentSet->_print_body(Object(stdClass), false)
  | #14 /var/www/html/src/componentset.php(541): ComponentSet->print(Object(stdClass))
  | #15 /var/www/html/src/pages/p_home.php(109): ComponentSet->print_members('home/main')
  | #16 /var/www/html/src/componentset.php(279): Home_Page->print_content(Object(Contact), Object(Qrequest), Object(ComponentSet), Object(stdClass))
  | #17 /var/www/html/src/componentset.php(497): ComponentSet->call_function(Object(stdClass), Array, Object(stdClass))
  | #18 /var/www/html/src/componentset.php(484): ComponentSet->_print_body(Object(stdClass), false)
  | #19 /var/www/html/src/componentset.php(541): ComponentSet->print(Object(stdClass))
  | #20 /var/www/html/src/componentset.php(505): ComponentSet->print_members('home')
  | #21 /var/www/html/src/componentset.php(526): ComponentSet->_print_body(Object(stdClass), true)
  | #22 /var/www/html/index.php(46): ComponentSet->print_body_members('home')
  | #23 /var/www/html/index.php(85): handle_request(Object(NavigationState))

<br />
--
  | <b>Warning</b>:  Undefined global variable $_SESSION in <b>/var/www/html/lib/phpqsession.php</b> on line <b>27</b><br />
  | <br />
  | <b>Warning</b>:  Undefined global variable $_SESSION in <b>/var/www/html/lib/phpqsession.php</b> on line <b>27</b><br />
  | <br />
  | <b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /var/www/html/src/conference.php:4355) in <b>/var/www/html/lib/base.php</b> on line <b>773</b><br />

Any suggestions? Thanks.

kohler commented 6 months ago

Are you running current git or a snapshot? I believe this issue was fixed in 303e3394d05f691af7c7d32250e8c70358e3d403 in January.

xcompass commented 6 months ago

Thanks. I did a git pull on Jan 19. And the fix was in Jan 20's commit..... It's fixed now. Thanks!