Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Django middleware that prevents user sessions from expiration.

Project Description


This Django middleware prevents user sessions from expiration.


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.


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.


pip install django-everlasting-sessions


Add the middleware to

        'django_everlasting_sessions.UpdateSessionMiddleware',  # Must go after SessionMiddleware

The rest will happen automatically.


The following default is used which you can override in

SESSION_COOKIE_REFRESH = 86400  # Interval in seconds.

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(1.3 kB) Copy SHA256 Hash SHA256
Source None Apr 1, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate