I'm trying to close the session when the user closes the browser or the tab.
I saw that SESSION_EXPIRE_AT_BROWSER_CLOSE
is supposed to do that. However it doesn't seem to work.
I have successfully implemented the session_security
plugin (as suggested in this answer).
My settings look as follows:
SESSION_SAVE_EVERY_REQUEST = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_SECURITY_WARN_AFTER = 120
SESSION_SECURITY_EXPIRE_AFTER = 240
I've tried both with SESSION_SAVE_EVERY_REQUEST
set to True
and False
, but the session is still open when I relaunch the browser.
Any tips?