Cookie bugfix, removed 'session' string from expiry/age

This commit is contained in:
Vivek Santayana 2021-12-08 11:26:18 +00:00
parent 6be20568a8
commit 70671adac8

View File

@ -7,14 +7,15 @@ cookie_consent = Blueprint(
)
@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 'Session',
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 'Session',
domain = '.reftest.vsnt.uk',
expires = datetime.utcnow() + timedelta(days=14) if request.cookies.get('remember') else None,
domain = f'.{app.config["SERVER_NAME"]}',
secure = True
)
return resp