mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-10-23 14:09:31 +00:00
[IMP] session_redis: add absolute expiration option
ODOO_SESSION_REDIS_EXPIRATION_ABSOLUTE=1 makes authenticated sessions expire ODOO_SESSION_REDIS_EXPIRATION seconds after the login, whatever the activity. Default mode: SET … EX instead of SET then EXPIRE, so a failed EXPIRE can no longer leave a key without TTL. rotate() also resets should_rotate, as odoo.http.FilesystemSessionStore does.
This commit is contained in:
1 parent
5108bfe728
commit
ff8cd092bd
7 files changed
+186
-5
No files matched your search
@@ -40,6 +40,7 @@ url = os.environ.get("ODOO_SESSION_REDIS_URL")
|
||||
password = os.environ.get("ODOO_SESSION_REDIS_PASSWORD")
|
||||
expiration = os.environ.get("ODOO_SESSION_REDIS_EXPIRATION")
|
||||
anon_expiration = os.environ.get("ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS")
|
||||
absolute_expiration = is_true(os.environ.get("ODOO_SESSION_REDIS_EXPIRATION_ABSOLUTE"))
|
||||
|
||||
|
||||
@lazy_property
|
||||
@@ -56,6 +57,7 @@ def session_store(self):
|
||||
prefix=prefix,
|
||||
expiration=expiration,
|
||||
anon_expiration=anon_expiration,
|
||||
absolute_expiration=absolute_expiration,
|
||||
session_class=http.Session,
|
||||
)
|
||||
|
||||
|
||||