Skip to content

Latest commit

 

History

History
54 lines (32 loc) · 1.24 KB

README.rst

File metadata and controls

54 lines (32 loc) · 1.24 KB

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