forked from orbit-oss/flask
session expiration datetime is UTC timezone-aware
This commit is contained in:
parent
cec5f74110
commit
ed42e92928
3 changed files with 7 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ import typing as t
|
|||
import warnings
|
||||
from collections.abc import MutableMapping
|
||||
from datetime import datetime
|
||||
from datetime import timezone
|
||||
|
||||
from itsdangerous import BadSignature
|
||||
from itsdangerous import URLSafeTimedSerializer
|
||||
|
|
@ -277,7 +278,7 @@ class SessionInterface:
|
|||
lifetime configured on the application.
|
||||
"""
|
||||
if session.permanent:
|
||||
return datetime.utcnow() + app.permanent_session_lifetime
|
||||
return datetime.now(timezone.utc) + app.permanent_session_lifetime
|
||||
return None
|
||||
|
||||
def should_set_cookie(self, app: "Flask", session: SessionMixin) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue