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.2.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

django_session_timeout-0.0.2-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.2.tar.gz.

File metadata

File hashes

Hashes for django-session-timeout-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a2eae69a722c178f49b932b982fae8106967482c9591b62e04c2e443033a29f0
MD5 173cf151b7e0a094b6dc3818dc71cc2e
BLAKE2b-256 ded99a4e8e060768960c8cd84ed96d0d00cdb948696aae12f8355a2bab3dc1e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_session_timeout-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 44f47f907f4a2df5fbd590b925b4565d443fe7370f7c74a0d686c645723dad83
MD5 6b42b8dedd6c614f2da44516a40c61c3
BLAKE2b-256 2b698d77eea7da055ed39ad0f435f2ac3548ed8f15f330a5fda5deac917ce08b

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