fix: fixed session clearing and let logout_user take care of cleanup

It seems when logging in and logging out, then logging back in, setting
the session timeout to 5 minutes, then waiting for expiry can cause
a situation when using SQLA-based sessions which results in a NULL field
in the database and causes a persistent 500 Internal Server Error.

As per issue 1439 here is a fix found by @raunz.

Resolves #1439.

Tested for about 8 hours and tons and tons of expired sessions, could not
reproduce with the fix applied.
This commit is contained in:
Nigel Kukard 2023-03-18 19:14:58 +00:00
parent 340e84ab89
commit f44ff7d261

View File

@ -528,7 +528,6 @@ def clear_session():
session.pop('google_token', None) session.pop('google_token', None)
session.pop('authentication_type', None) session.pop('authentication_type', None)
session.pop('remote_user', None) session.pop('remote_user', None)
session.clear()
logout_user() logout_user()