-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[4.2] Fix file locking issue with Laravel file sessions #6848
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
Conversation
There are quite a few cs issues here. I'm going to comment on them all... |
@@ -3,7 +3,15 @@ | |||
use Symfony\Component\Finder\Finder; | |||
use Illuminate\Filesystem\Filesystem; | |||
|
|||
class FileSessionHandler implements \SessionHandlerInterface { | |||
class FileSessionHandler implements \SessionHandlerInterface | |||
{ |
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.
revert
I can't recreate the bug people a few people have mentioned. I cloned down the one guy's test repository and ran it probably 30-40 times and never saw the bug once. What am I missing? |
I don't know anything about the test repo that you're mentioning, but we encountered the bug when having a browser, representing a logged in user, make 10 - 15 concurrent requests. Not always, but sometimes 1 of the concurrent requests would fail claiming to not be logged in - the session ID would be different from all of the other requests. |
@avi123 Could you fix those issues that I've highlighted please. |
Is anyone able to test this please and confirm that this does work? If we can't get this 100% clear, then this will have to be retargeted to 5.0. Once the psr-2 changes go into laravel 5.0, laravel 4.2 will become locked for all improvements or edge cases fixes like this. |
Also note, for anyone coming to this and reading my last comment here, Laravel 5 never moved to PSR-2, and there are no plans to in the near future. |
I'm assuming this never got worked into anything. I've just run into this issue and am in need of getting it fixed. I've put together a sample repository here: https://github.com/wiseloren/laravel-race That shows the problem. I've only tested with the file driver since I didn't have a database handy for the test project. I'm willing to work on the code, though, I'm guessing I'll need to find and fix the correct files in 5.0 instead of 4.2. |
I can confirm that this fix fixes the issues in the laravel race repository causing everything to properly be incremented. |
Nice, fixes my issue! |
@loren138 I know this has been a while, but I've created a ServiceProvider: |
No description provided.