fix: Ensure anonymous session timeout is applied when expiration is not an integer or is zero.

This commit is contained in:
nbessi committed 2025-11-26 11:40:01 +01:00
1 parent 750bc4dcf8
commit 80af680aae
1 file changed
+4
+4
View File
@@ -96,6 +96,10 @@ class RedisSessionStore(SessionStore):
"utf-8"
)
if self.redis.set(key, data):
if type(expiration) != int:
expiration = DEFAULT_SESSION_TIMEOUT_ANONYMOUS
if expiration == 0:
expiration = DEFAULT_SESSION_TIMEOUT_ANONYMOUS
return self.redis.expire(key, expiration)
def delete(self, session):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.