Hi,
I have been going crazy for the past few days trying to understand sessions, my settings.py file as the following,
-- I have been going crazy for the past few days trying to understand sessions, my settings.py file as the following,
SESSION_SAVE_EVERY_REQUEST=True
SESSION_COOKIE_AGE=2*60
Now whenever a request is initiated shoudn't the expiry date of the cookie i.e the one that holds the session id ,doubled i.e become four minutes. This is not happening and I am using chrome. Is this normal? I don't think so,from the amount of stackoverflow posts on this discussion.
Now towards the second part of the question, Forget about what I have said till now, now my settings.py contains only this.
SESSION_EXPIRE_AT_BROWSER_CLOSE=True.
A user "admin" has initiated a request, done some work closed his browser, session cookie holding the session id has expired and that's wonderful as expected.
Now If I run this snippet,
from django.contrib.sessions.models import Session
from django.utils import timzone
sessions = Sessions.objects.filter(expire_date__gte=timezone.now())
The above queryset has the session of the admin user, I am confused is this expected behavior? Can someone please address the queries for me.
Thank you
regards
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-users@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/464b49f3-9a01-41e1-a187-674c7bdcb380%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment