mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 00:03:03 +08:00
Set samesite and secure attributes of session cookie. Enable strong session protection.
This commit is contained in:
parent
0e4799030d
commit
e7c3a127b8
2 changed files with 4 additions and 0 deletions
|
@ -5,4 +5,5 @@ from flask_sqlalchemy import SQLAlchemy
|
|||
|
||||
db = SQLAlchemy()
|
||||
login_manager = LoginManager()
|
||||
login_manager.session_protection = "strong"
|
||||
migrate = Migrate(db=db)
|
||||
|
|
|
@ -83,6 +83,9 @@ def create_app() -> Flask:
|
|||
|
||||
# to avoid conflict with other cookie
|
||||
app.config["SESSION_COOKIE_NAME"] = "slapp"
|
||||
if URL.startswith("https"):
|
||||
app.config["SESSION_COOKIE_SECURE"] = True
|
||||
app.config["SESSION_COOKIE_SAMESITE"] = "strict"
|
||||
|
||||
init_extensions(app)
|
||||
register_blueprints(app)
|
||||
|
|
Loading…
Reference in a new issue