django-everlasting-sessions
This Django middleware prevents user sessions from expiration.
Problem
When using django.contrib.sessions.middleware.SessionMiddleware, Django only saves the session cookie when a session is modified. On a typical site that only happens when a user logs in. In two weeks this session cookie expires and the user is prompted to login again, even if he’s been actively using the site.
Solution
django-everlasting-sessions provides a middleware that will update session cookies once in a while (every day by default), provided there is some activity from the user.
Installation
pip install django-everlasting-sessions
Usage
Add the middleware to settings.py:
MIDDLEWARE_CLASSES = [
...
'django.contrib.sessions.middleware.SessionMiddleware',
'django_everlasting_sessions.UpdateSessionMiddleware', # Must go after SessionMiddleware
...
]
The rest will happen automatically.
Options
The following default is used which you can override in settings.py:
SESSION_COOKIE_REFRESH = 86400 # Interval in seconds.
Metadata
Release files for django-everlasting-sessions 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-everlasting-sessions-0.0.4.tar.gz | 1.3 kB | Without provenance | Details for django-everlasting-sessions-0.0.4.tar.gz |
Release files / django-everlasting-sessions-0.0.4.tar.gz
| Download URL | django-everlasting-sessions-0.0.4.tar.gz |
|---|---|
| Size | 1.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a6b91c960a4a872e85ad78e179a6b19b60de1193c6474177e2b10d17aa251c5
|
|
BLAKE2b-256 checksum How to use checksums |
7a1d4c358cbafe66c4806902aba0d279703a75dd77368eb72ebac1090bd1cf0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-everlasting-sessions 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.