Skip to content
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

Garbage collector fails if session lock directory does not exist #29

Closed
stefanvdlugt opened this issue Aug 15, 2023 · 1 comment
Closed

Comments

@stefanvdlugt
Copy link

Hello,

We are using the session handler's gc() method to automatically remove sessions after an update if this is necessary. However, this fails if the directory /tmp/sessionlocks does not yet exist (e.g. when starting for the first time).

[stacktrace]
#0 /var/www/html/vendor/rairlie/laravel-locking-session/src/Rairlie/LockingSession/Lock.php(81): Symfony\\Component\\Finder\\Finder->in()
#1 /var/www/html/vendor/rairlie/laravel-locking-session/src/Rairlie/LockingSession/LockingSessionHandler.php(38): Rairlie\\LockingSession\\Lock->gcLockDir()
#2 /var/www/html/app/Console/Commands/FlushSessions.php(20): Rairlie\\LockingSession\\LockingSessionHandler->gc()

We are able to circumvent this exception by first reading/writing a dummy session to ensure the lock dir exists, but we feel that this situation should be handled more gracefully by the gc() method.

@rairlie
Copy link
Owner

rairlie commented Aug 17, 2023

Hi, thanks for your bug report This is now resolved in v2.0.1

@rairlie rairlie closed this as completed Aug 17, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants