Removed personal information
This commit is contained in:
parent
b3791dfcf8
commit
7c70da4b5c
21
ref-test/common/blueprints.py
Normal file
21
ref-test/common/blueprints.py
Normal file
@ -0,0 +1,21 @@
|
||||
from datetime import datetime, timedelta
|
||||
from flask import Blueprint, redirect, request
|
||||
|
||||
cookie_consent = Blueprint(
|
||||
'cookie_consent',
|
||||
__name__
|
||||
)
|
||||
@cookie_consent.route('/')
|
||||
def _cookies():
|
||||
from main import app
|
||||
resp = redirect('/')
|
||||
resp.set_cookie(
|
||||
key = 'cookie_consent',
|
||||
value = 'True',
|
||||
max_age = timedelta(days=14) if request.cookies.get('remember') == 'True' else None,
|
||||
path = '/',
|
||||
expires = datetime.utcnow() + timedelta(days=14) if request.cookies.get('remember') else None,
|
||||
domain = f'.{app.config["SERVER_NAME"]}',
|
||||
secure = True
|
||||
)
|
||||
return resp
|
Loading…
Reference in New Issue
Block a user