Skip to content

davisnando/django-session-timeout

Repository files navigation

django-session-timeout

Status

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

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

About

Add timestamp to sessions to expire them

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 93.7%
  • Makefile 6.3%