Good day;
Please i need help on the issues am facing on SESSION_EXPIRE_AT_BROWSER_CLOSE django settings.py. In my setting file i have:
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
but unfortunately, whenever my users close there browsers and open it again, they are login automatically, which shows that the session did not expire.
Am facing this issue on all browers.
On chrome, when i went to the settings and manually choose to expire cookies, the SESSION_EXPIRE_AT_BROWSER_CLOSE worked.
In deployed application, i can not be asking my users to be changing cookies setting in their browsers.
Please how can i achieve session expire after closing browser irrespective of user browser settings. Or if there is javasctipt snippet i can use to control this.
Thanks in advance.
soliu - fxSoftlogix
Thanks Mr James for the urgent reply.
Even when the server and the user pc are restarted after the setting, the situation is the same.
from the django docs; there is a section that goes :
Note
Some browsers (Chrome, for example) provide settings that allow users to continue browsing sessions after closing and re-opening the browser. In some cases, this can interfere with the SESSION_EXPIRE_AT_BROWSER_CLOSE setting and prevent sessions from expiring on browser close. Please be aware of this while testing Django applications which have the SESSION_EXPIRE_AT_BROWSER_CLOSE setting enabled.
Maybe this is what is causing the issue. but i just think that people must have a way of going around this problem.
Make sure you're not looking at users who already had a session cookie set before you changed the setting. Existing cookies might not get immediately rewritten to have the shorter expiration.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL13Cg-ycUN1cjiy_sbtdvRYa0sF4KMVHUK%2B%2BTipC1GCy0XWww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
thanks again Mr James.
am able to solve the problem now by running the management command "python manage.py clearsessions".
This pratically delete all the session stored on the django session database.
so SESSION_EXPIRE_AT_BROWSER_CLOSE behave as it should now.
Make sure you're not looking at users who already had a session cookie set before you changed the setting. Existing cookies might not get immediately rewritten to have the shorter expiration.
--
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/add560a7-21ee-4971-98fd-8e8dc66c6b13%40googlegroups.com.