Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork87
Fix "Session object destruction failed" - update#86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Sorry, have to study how run tests before pull request... |
And try to fix the current one, not to open another :) |
@@ -217,9 +217,9 @@ public function regenerateId() | |||
throw new Nette\InvalidStateException('Cannot regenerate session ID after HTTP headers have been sent' . ($file ? " (output started at $file:$line)." : '.')); | |||
} | |||
if (session_id() !== '') { | |||
session_write_close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@luhla Maybe thesession_write_close();
should be before the if. That should fix the failing test as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I did try it before, but result was also failed checks. Solution is session_write_close(); before session_regenerate_id(TRUE); in my case but I wouldnt do annoing tests here.
Can you explain what is it good for? |
Getting "session_regenerate_id(): Session object destruction failed" when calling before session_write_close(); |
dg commentedJun 20, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Is it needed to call session_write_close() when session_id() === '' ? Or now we can usehttp://php.net/manual/en/function.session-status.php |
Getting error when using:
Everithing fine when using:
|
Change sessions state detection
readded session_write_close(); deleted by mistake
IMHO session_write_close(); should be in condition too. |
session_write_close moved to condition
session_write_close readded after condition
Did you change the order of session_write_close and session_regenerate_id intentionally? |
Make no sense for me, where should be session_write_close() "in condition too" ? |
dg commentedJun 20, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Why must be another after condition? Why call it when session is not active? |
luhla commentedJun 20, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Well, thats true, it might not, when seesion status is not active, nothing will be writen to session. I will fix it. |
Thanks! |
Thanks for nothing, you did the solution. :-) |
No description provided.