Skip to content

Commit

Permalink
Use redis set command instead of setex
Browse files Browse the repository at this point in the history
  • Loading branch information
Lxstr committed Jan 8, 2024
1 parent c4e4157 commit 2c724b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
3 changes: 1 addition & 2 deletions src/flask_session/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2c724b0

Please sign in to comment.