From 7e341192b65d5f247b5a28c19e4e886a3cfc4b4f Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Wed, 4 Oct 2023 13:28:54 -0400 Subject: [PATCH] Updating cookie expiration to better handle portal authentication issue --- src/routes/auth/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/auth/__init__.py b/src/routes/auth/__init__.py index e819b1c0..b571c9bb 100644 --- a/src/routes/auth/__init__.py +++ b/src/routes/auth/__init__.py @@ -110,10 +110,11 @@ def _login(redirect_uri, key = 'tokens'): # create a response for the user response = make_response(redirect(redirect_uri)) + #Use max_age (seconds) as opposed to expires (date). Set token to expire after 1 day if current_app.config['COOKIE_DOMAIN'] == 'localhost': - response.set_cookie('info', base64_json_str, expires=2**31 - 1) + response.set_cookie('info', base64_json_str, max_age=86400) else: - response.set_cookie('info', base64_json_str, expires=2**31 - 1, domain=current_app.config['COOKIE_DOMAIN']) + response.set_cookie('info', base64_json_str, max_age=86400, domain=current_app.config['COOKIE_DOMAIN']) return response