From 79b2b5cff8ab1db1bc716965f6083d65c9ea5bbc Mon Sep 17 00:00:00 2001 From: justcool393 Date: Mon, 21 Nov 2022 09:36:22 -0600 Subject: [PATCH] cookies: set SameSite Lax to get rid of annoying console warning --- files/routes/allroutes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/allroutes.py b/files/routes/allroutes.py index 8184ad4b6..4d09cda16 100644 --- a/files/routes/allroutes.py +++ b/files/routes/allroutes.py @@ -47,7 +47,8 @@ def after_request(response): if response.status_code < 400: if CLOUDFLARE_AVAILABLE and CLOUDFLARE_COOKIE_VALUE and getattr(g, 'desires_auth', False): logged_in = bool(getattr(g, 'v', None)) - response.set_cookie("lo", CLOUDFLARE_COOKIE_VALUE if logged_in else '', max_age=60*60*24*365 if logged_in else 1) + response.set_cookie("lo", CLOUDFLARE_COOKIE_VALUE if logged_in else '', + max_age=60*60*24*365 if logged_in else 1, samesite="Lax") if getattr(g, 'db', None): g.db.commit() g.db.close()