Opened 4 years ago
Last modified 3 years ago
#32088 closed New feature
Django Database Sessions - Can't Retrieve expire_date — at Initial Version
Reported by: | Nate Pinchot | Owned by: | nobody |
---|---|---|---|
Component: | contrib.sessions | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For Django database sessions, there is no way to retrieve the datetime that the session will expire without directly querying the model. The model stores this value in the expire_date
field, but it is not able to be retrieved from the session object. This makes it complicated to implement sliding expiration sessions if the sessions are not being modified by some other means.
Of course, we could set SESSION_SAVE_EVERY_REQUEST = True
to cause the session to be modified on every request, but this is inefficient.