This app provides a mechanism to logout inactive authenticated users. An inactive browser should be logged out automatically if the user left his workstation, to protect sensitive data that may be displayed in the browser. It may be useful for CRMs, intranets, and such projects.
For example, if the user leaves for a coffee break, this app can force logout after say 5 minutes of inactivity.
Or “Why does this app even exist” ? Here are the reasons:
This app allows to short circuit those limitations in session expiry.
When the user loads a page, SessionSecurity middleware will set the last activity to now. The last activity is stored as datetime in request.session['_session_security']. To avoid having the middleware update that last activity datetime for a URL, add the url to settings.SESSION_SECURITY_PASSIVE_URLS.
First, a warning should be shown after settings.SESSION_SECURITY_WARN_AFTER seconds. The warning displays a text like “Your session is about to expire, move the mouse to extend it”.
Before displaying this warning, SessionSecurity will upload the time since the last client-side activity was recorded. The middleware will take it if it is shorter than what it already has - ie. another more recent activity was detected in another browser tab. The PingView will respond with the number of seconds since the last activity - all browser tab included.
You could subscribe to the mailing list ask questions or just be informed of package updates.