cookies: set SameSite Lax to get rid of annoying console warning

master
justcool393 2022-11-21 09:36:22 -06:00
parent 423418e488
commit 79b2b5cff8
1 changed files with 2 additions and 1 deletions

View File

@ -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()