Closed Kolarovszki closed 7 months ago
hi, something is blocking this request? I'm very interested in this feature
Both these features is now included in 0.7.0 PR #212 as flask session_cleanup
command and alternatively, SESSION_CLEANUP_N_REQUESTS
. Also added direct TTL for mongo so there should be no cleanup required.
The expired sessions are not deleted from the database in every case, so the autodeletion of expired sessions has been implemented.
Deletion of the expired sessions (e.g. with a cronjob) would be feasible in the application, but it is nicer to implement it directly in flask-session.
The autodeletion be enabled by the
SESSION_AUTODELETE
config variable, which defaults toFalse
.Major drawback: it slows down
open_session
.