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.
This commit is contained in:
Adeodato Simó 2024-01-24 19:30:45 +01:00
parent c9e6dcc2d9
commit 82f9aa9da4
No known key found for this signature in database
GPG key ID: CDF447845F1A986F

View file

@ -30,6 +30,9 @@ RELEASE_API = env(
PAGE_LENGTH = env.int("PAGE_LENGTH", 15) PAGE_LENGTH = env.int("PAGE_LENGTH", 15)
DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English") 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" JS_CACHE = "ac315a3b"