forked from MarseyWorld/MarseyWorld
cookies: set SameSite Lax to get rid of annoying console warning
parent
423418e488
commit
79b2b5cff8
|
@ -47,7 +47,8 @@ def after_request(response):
|
||||||
if response.status_code < 400:
|
if response.status_code < 400:
|
||||||
if CLOUDFLARE_AVAILABLE and CLOUDFLARE_COOKIE_VALUE and getattr(g, 'desires_auth', False):
|
if CLOUDFLARE_AVAILABLE and CLOUDFLARE_COOKIE_VALUE and getattr(g, 'desires_auth', False):
|
||||||
logged_in = bool(getattr(g, 'v', None))
|
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):
|
if getattr(g, 'db', None):
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
g.db.close()
|
g.db.close()
|
||||||
|
|
Loading…
Reference in New Issue