Explicitly set cookie SameSite attribute to Lax

With 'Secure' set, it may default to 'None', which we don't need or want.

'Strict' is not suitable for session cookies - the user would see the login
screen when navigating from another site (e.g. hosting dashboard) and we
already have CSRF protection on forms.
This commit is contained in:
Matthew Wild
2024-04-29 11:18:55 +01:00
parent a8c6b1a70c
commit 6407eb90db

View File

@@ -213,6 +213,7 @@ def create_app() -> quart.Quart:
app.config["ABUSE_EMAIL"] = config.abuse_email
app.config["SECURITY_EMAIL"] = config.security_email
app.config["SESSION_COOKIE_SECURE"] = True
app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
app.context_processor(proc)
app.register_error_handler(