How to Logoff Automatically from Admin UI?ΒΆ

Sometimes it is required to automatically log off from the Admin UI after certain number of minutes (for example for internal security certification requirements). How to set this up?

In order to implement this, use the https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-SESSION_COOKIE_AGE setting. Open the /opt/websafety-ui/var/console/console/settings.py file and somewhere after SESSION_EXPIRE_AT_BROWSER_CLOSE = True add another line containing:

# auto expire after 2 minutes
SESSION_COOKIE_AGE = 2*60

Save the file, and restart Apache by systemctl restart apache2. Now after you login into Admin UI and leave it open for more than 2 minutes and try to click anything - you will be redirected to the login page.