Make cookies more secure
This commit is contained in:
parent
d75732fdcf
commit
b12bcc882d
1 changed files with 9 additions and 0 deletions
|
@ -94,6 +94,15 @@ def register_plugins(app: Flask, debug: bool) -> Manager:
|
|||
# Load the flask debug toolbar
|
||||
toolbar = DebugToolbarExtension(app)
|
||||
|
||||
# Make cookies more secure
|
||||
app.config.update(
|
||||
SESSION_COOKIE_HTTPONLY=True,
|
||||
SESSION_COOKIE_SAMESITE='Lax',
|
||||
)
|
||||
|
||||
if not app.debug:
|
||||
app.config.update(SESSION_COOKIE_SECURE=True)
|
||||
|
||||
return manager
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue