Managing user web sessions
DJANGO_SESSION_COOKIE_AGE
DJANGO_SESSION_SAVE_EVERY_REQUEST
DJANGO_SESSION_EXPIRE_AT_BROWSER_CLOSE
DJANGO_SESSION_SAVE_EVERY_REQUEST
set to true
, the server will update the session with each request. Updates reset the expiration, so a short expiry period won’t log out anyone actively using Ghostwriter but will allow inactive sessions to expire.
If set to true
, the last option will expire sessions after the browser quits. However, whether the session ends when you close the browser window depends on the browser. Some browsers, like Chrome, will keep sessions active, so you may need to quit or exit the browser to end the session versus just closing the browser window.
You can manage these values via the Ghostwriter command-line interface (CLI) tool.
django.core.management.call_command
and pass "clearsessions"
as its only argument. Set up a task like this one that runs daily with the cron scheduler. For example, 0 5 * * *
will run it every day at 5:00 AM.