From 40a12f35d7376a17ef8db2a196d83d12593811e4 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Mon, 21 Jun 2021 13:08:04 +0200 Subject: [PATCH] allow modifying session cookie behavior --- .env.template | 7 ++++++- recipes/settings.py | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.env.template b/.env.template index bd0c6c52..c37bf68a 100644 --- a/.env.template +++ b/.env.template @@ -111,4 +111,9 @@ REVERSE_PROXY_AUTH=0 # SOCIAL_DEFAULT_ACCESS = 1 # if SOCIAL_DEFAULT_ACCESS is used, which group should be added -# SOCIAL_DEFAULT_GROUP=guest \ No newline at end of file +# SOCIAL_DEFAULT_GROUP=guest + +# Django session cookie settings. Can be changed to allow a single django application to authenticate several applications +# when running under the same database +# SESSION_COOKIE_DOMAIN=.example.com +# SESSION_COOKIE_NAME=sessionid # use this only to not interfere with non unified django applications under the same top level domain \ No newline at end of file diff --git a/recipes/settings.py b/recipes/settings.py index 6e595789..ec5c9556 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -126,6 +126,9 @@ ACCOUNT_LOGOUT_ON_GET = True SOCIALACCOUNT_PROVIDERS = ast.literal_eval( os.getenv('SOCIALACCOUNT_PROVIDERS') if os.getenv('SOCIALACCOUNT_PROVIDERS') else '{}') +SESSION_COOKIE_DOMAIN = os.getenv('SESSION_COOKIE_DOMAIN', None) +SESSION_COOKIE_NAME = os.getenv('SESSION_COOKIE_DOMAIN', 'sessionid') + ENABLE_SIGNUP = bool(int(os.getenv('ENABLE_SIGNUP', False))) ENABLE_METRICS = bool(int(os.getenv('ENABLE_METRICS', False)))