-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.3] Fix empty session #15998
[5.3] Fix empty session #15998
Conversation
Fix session being empty when the file is being read and/or written by multiple instance of apache simultaneously. This append to me when assets (javascript / css) are being loaded dynamically using php. Multiples assets in the same request cause the sessions to be corrupted.
@GrahamCampbell @themsaid do you know of any problems with this? |
Hey @taylorotwell I have the same issue when using multiple I can reproduce this issue with my Admin panel that is built for Laravel on a fresh install of Laravel. |
Looks ok. I guess it doesn't matter that much, since any real usage will be using apc or redis, or the like. |
From all the debug and tests I did, the error I encounter was really when the same session file was read/write more than once in a very very short time period (simultaneously). It would randomly return noting. Probably something related to As seen here, adding the |
So adding this change fixed your original problem in your tests? |
Yes. Like I said, this force php to get a read lock on the file before reading it's content, assuring the file will indeed be read correctly. So the file read won't return en empty string as the session data, forcing a new session to be created by our system. |
it seems to fix my issue #15551, too! |
What you describe in #15551 is similar to the problem I had, so good chances this indeed fixed your error too ;) |
Fix session being empty when the file is being read and/or written by multiple instance of apache simultaneously. This append to me when assets (javascript / css) are being loaded dynamically using php. Multiples assets in the same request cause the sessions to be corrupted.