Skip to content
Snippets Groups Projects
Commit f73526b8 authored by Art's avatar Art :lizard:
Browse files

Add session lifetime check.

parent 546ca0ea
No related branches found
No related tags found
No related merge requests found
......@@ -78,3 +78,15 @@ def auth_urls_configured(app_configs, **kwargs):
errors.append(Warning("{setting_name} is not found or invalid.".format(**locals()), obj=conf.settings,))
return errors
@register(Tags.security)
def session_lifetime(app_configs, **kwargs):
errors = list()
max_wanted = 60 * 60 # seconds
if conf.settings.SESSION_COOKIE_AGE > max_wanted:
errors.append(Error(
"Please reduce SESSION_COOKIE_AGE to at most {max_wanted}".format(**locals()),
obj=conf.settings,
))
return errors
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment