From 2c724b00354222a2aea52b177c3a9c18454fa60d Mon Sep 17 00:00:00 2001 From: Lex Date: Mon, 8 Jan 2024 14:02:51 +1000 Subject: [PATCH] Use redis set command instead of setex --- CHANGES.rst | 1 + src/flask_session/sessions.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2f52c04b..34c965df 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,7 @@ Released 2023-00-00 entropy (was previously 122). - Introduce SESSION_KEY_LENGTH to control the length of the session key in bytes, default is 32. - Fix expiry is None bug in SQLAlchemy. +- Drop support for Redis < 2.6.12. Version 0.5.0 ------------- diff --git a/src/flask_session/sessions.py b/src/flask_session/sessions.py index 3ee19d9f..9452d063 100644 --- a/src/flask_session/sessions.py +++ b/src/flask_session/sessions.py @@ -182,8 +182,7 @@ def save_session(self, app, session, response): expires = self.get_expiration_time(app, session) val = self.serializer.dumps(dict(session)) - self.redis.setex(name=self.key_prefix + session.sid, value=val, - time=total_seconds(app.permanent_session_lifetime)) + self.redis.set(name=self.key_prefix + session.sid, value=val, ex=total_seconds(app.permanent_session_lifetime)) self.set_cookie_to_response(app, session, response, expires)