You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a strange fenomenon:
On one subdomain (user tests) I am using the nearly same redirects but get no errors...
On the other subdomain (integration tests) I made a fresh install with a slight change (full domain - not relative header location calls) but got weird behaviour: It's actually not redirecting...
because Auth is already sending out headers...
But I have no clue why the code works in one subdomain, but in slight variation ( header('Location http://subdomain/folder/file.php) ) it doesn't... Specially why my change would provoke a different behaviour in Auth
representative Code (produces empty page, no redirect):
PD: Fact is: after running the code I am still logged in...
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 73
Warning: Cannot modify header information - headers already sent by (output started at /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php:73) in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 87
Warning: Cannot modify header information - headers already sent by (output started at /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php:73) in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 92
Warning: Cannot modify header information - headers already sent by (output started at /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php:73) in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 94
Warning: Cannot modify header information - headers already sent by (output started at /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php:73) in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 97
Warning: Cannot modify header information - headers already sent by (output started at /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php:73) in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php:73) in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 99
Fatal error: Uncaught exception 'Delight\Auth\HeadersAlreadySentError' in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php:320 Stack trace: #0 /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php(277): Delight\Auth\Auth->setRememberCookie(NULL, NULL, 1495128213) #1 /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php(371): Delight\Auth\Auth->deleteRememberDirective(50) #2 /home/user/subdomain.whatever.com/logout.php(15): Delight\Auth\Auth->logout() #3 {main} thrown in /home/user/subdomain.whatever.com/vendor/delight-im/auth/src/Auth.php on line 320
The text was updated successfully, but these errors were encountered:
I can confirm that I've had this issue (or one very similar). Unfortunately I don't have a test case, but my workaround was using \Delight\Cookie\Cookie::setcookie instead of $_SESSION
@rgvy Thanks for helping! That code change was probably only part of the workaround, or something else caused the problem to go away :)
@PatrickCaneloDigital Thanks for resolving the issue and for explaining what caused the problem in this specific case.
In general, the "headers already sent" error occurs whenever some output has been written to the response body and you still try to set or modify HTTP headers after that. This does not work, because as soon as you write text or binary data to the output, the server may send the HTTP headers (which go before the output) to the client. Often, this happens because you have accidentally written some whitespace to the output, as in this case.
I have a strange fenomenon:
On one subdomain (user tests) I am using the nearly same redirects but get no errors...
On the other subdomain (integration tests) I made a fresh install with a slight change (full domain - not relative header location calls) but got weird behaviour: It's actually not redirecting...
because Auth is already sending out headers...
But I have no clue why the code works in one subdomain, but in slight variation ( header('Location http://subdomain/folder/file.php) ) it doesn't... Specially why my change would provoke a different behaviour in Auth
representative Code (produces empty page, no redirect):
PD: Fact is: after running the code I am still logged in...
Error:
The text was updated successfully, but these errors were encountered: