How to set the session not to expire on browser close in Django?
I created cookie with expiry days:
In setting.py
I added SESSION_EXPIRE_AT_BROWSER_CLOSE = False
and
SESSION_COOKIE_AGE = 1440 * 60
.
When I logged in, cookies are created, but the attribute Expires
for the cookie is "When the browsing session ends and sessionid
cookies expires on (1 day time) 24 hours".
When I close the tab and reopen it, it keeps session continuous, but when I close the browser and reopen it, the cookies are also deleted, even sessionid
. So it redirects to the login page again.
I want to keep session continuous even after reopening the browser.