Skip to main content

Middleware to expire sessions after specific amount of time

Project description

Status

https://travis-ci.org/LabD/django-session-timeout.svg?branch=master http://codecov.io/github/LabD/django-session-timeout/coverage.svg?branch=master https://img.shields.io/pypi/v/django-session-timeout.svg

Installation

pip install django-session-timeout

Usage

Update your settings to add the SessionTimeoutMiddleware:

MIDDLEWARE_CLASSES = [
    # ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django_session_timeout.middleware.SessionTimeoutMiddleware',
    # ...
]

And also add the SESSION_EXPIRE_SECONDS:

SESSION_EXPIRE_SECONDS = 3600  # 1 hour

By default, the session will expire X seconds after the start of the session. To expire the session X seconds after the last activity, use the following setting:

SESSION_EXPIRE_AFTER_LAST_ACTIVITY = True

Project details


Download files

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

Source Distribution

django-session-timeout-0.0.3.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

django_session_timeout-0.0.3-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-session-timeout-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-session-timeout-0.0.3.tar.gz
Algorithm Hash digest
SHA256 339ce15fabe551a9dda5e6be484cf5ecf6f5be09665ca0907c06682cef0a146e
MD5 cda94baa87a6136e97907260f4c34e4f
BLAKE2b-256 7107b507eb4208aafca270116def9c1c694c37cd2e56f3f995247685ce2bb91a

See more details on using hashes here.

File details

Details for the file django_session_timeout-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_session_timeout-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 86c150f1cacd9e72748d85c79c30d3b3aa96d6fb00797a133e7310f880d68579
MD5 c3e0dde4918cafde343a1bfef758620d
BLAKE2b-256 16f76ca46271bcdfa1178b19df50f917c45235044cbb80aa530938586c281203

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page