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

[V2][Sessions] Cleanup regularly expired sessions #793

Closed
LoicPoullain opened this issue Aug 20, 2020 · 1 comment · Fixed by #792
Closed

[V2][Sessions] Cleanup regularly expired sessions #793

LoicPoullain opened this issue Aug 20, 2020 · 1 comment · Fixed by #792

Comments

@LoicPoullain
Copy link
Member

LoicPoullain commented Aug 20, 2020

Issue

When a session is expired in a TypeORMStore or MongoDBStore, it is destroyed only if the app tries to read it or if Store.cleanupExpiredSessions is called.

This means that users should run periodically the cleanupExpiredSessions method (like in Django).

This is not very handy. The framework should take care of this without multiplying by two the number of requests to the database.

Solution

Like in Laravel, cleanup the expired sessions regularly when a session is committed based on a random number between 0 and 50 (can be modified in the config)

@LoicPoullain
Copy link
Member Author

Resolved in v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant