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

Improve the session cookie check

parent 0fb94975
No related branches found
No related tags found
No related merge requests found
...@@ -124,10 +124,8 @@ def auth_urls_configured(app_configs, **kwargs): ...@@ -124,10 +124,8 @@ def auth_urls_configured(app_configs, **kwargs):
@register(Tags.security) @register(Tags.security)
def session_lifetime(app_configs, **kwargs): def session_lifetime(app_configs, **kwargs):
errors = list() errors = list()
if conf.settings.SESSION_EXPIRE_AT_BROWSER_CLOSE:
return errors
max_wanted = 60 * 60 # seconds max_wanted = 60 * 60 # seconds
if conf.settings.SESSION_COOKIE_AGE > max_wanted: if conf.settings.SESSION_COOKIE_AGE > max_wanted and not conf.settings.SESSION_EXPIRE_AT_BROWSER_CLOSE:
errors.append(Error( errors.append(Error(
"Please reduce SESSION_COOKIE_AGE to at most {max_wanted} or set SESSION_EXPIRE_AT_BROWSER_CLOSE = True".format(**locals()), "Please reduce SESSION_COOKIE_AGE to at most {max_wanted} or set SESSION_EXPIRE_AT_BROWSER_CLOSE = True".format(**locals()),
obj=conf.settings, obj=conf.settings,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment