Skip to main content

django-session-timeout

Add timestamp to sessions to expire them independently

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

By default, last activiy will be grouped per second. To group by different period use the following setting:

SESSION_EXPIRE_AFTER_LAST_ACTIVITY_GRACE_PERIOD = 60 # group by minute

To redirect to a custom URL define the following setting:

SESSION_TIMEOUT_REDIRECT = 'your_redirect_url_here/'

Metadata

Release files for django-session-timeout 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-session-timeout 0.1.0
File Size Uploaded Provenance Actions
django-session-timeout-0.1.0.tar.gz 2.9 kB Without provenance Details for django-session-timeout-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-session-timeout 0.1.0
File Interpreter ABI Platform Actions
django_session_timeout-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for django_session_timeout-0.1.0-py2.py3-none-any.whl

Total release size: 6.8 kB

Release files / django-session-timeout-0.1.0.tar.gz

Download URL django-session-timeout-0.1.0.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
648fe4ffa762f3bb62ce7a9ed1bbba8e37648158d555f18a880471982941084c
BLAKE2b-256 checksum
How to use checksums
6f989b3330c7e54360a94a3fdc43526deba8b7339d72a4f8da35799d79c1f608
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release files / django_session_timeout-0.1.0-py2.py3-none-any.whl

Download URL django_session_timeout-0.1.0-py2.py3-none-any.whl
Size 3.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e01b2502d4b9995edb93be1a66f304d0314cecb4f671ddc26cb4525a07e56282
BLAKE2b-256 checksum
How to use checksums
7ff11166326c05ff647e32c3b71e6e1afe15272ad7d6c1fad101a9d798f6c2f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Security for django-session-timeout 0.1.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page