Hi everyone!

In my login function in views.py I make use of set_expiry function to
set the cookie expriry time depending on the selection of a "remember
me" checkbox on the login form:

if not form.cleaned_data["rememberme"]:
    request.session.set_expiry(0)
else:
    request.session.set_expiry(2592000) # one month

This works ok, but if I increase the set_expiry in just one second for
the else case (2592001), the user does *not* log in, although it sets
the expiry time correctly for the cookie (I know how weird it sounds).

In my settings.py, I have commented the SESSION_COOKIE_AGE variable in
case that could be the source of the problem, but I get the same
behaviour.

# Sessions
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
#SESSION_COOKIE_AGE = 2592000
#SESSION_EXPIRE_AT_BROWSER_CLOSE = True

My question is: is there a max value for the set_expiry value? If not,
any ideas why the user does not get logged in?

Thank you in advance!

Pablo L.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.


Reply via email to