From 82f9aa9da4ae68c2e042bbb981c89d8089cd39dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Wed, 24 Jan 2024 19:30:45 +0100 Subject: [PATCH] Set SESSION_COOKIE_AGE from environment, default to one month While we do wish for a longer maximum age (up to one year, see #3082), we only want to do that after termination of active sessions is implemented (see #2278). In the meantime, by reading and setting the variable from settings, we allow site admins to alter the default. --- bookwyrm/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 16241f9df..4af7afb14 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -30,6 +30,9 @@ RELEASE_API = env( PAGE_LENGTH = env.int("PAGE_LENGTH", 15) DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English") +# TODO: extend maximum age to 1 year once termination of active sessions +# is implemented (see bookwyrm-social#2278, bookwyrm-social#3082). +SESSION_COOKIE_AGE = env.int("SESSION_COOKIE_AGE", 3600 * 24 * 30) # 1 month JS_CACHE = "ac315a3b"