Dan
unread,Nov 10, 2009, 5:36:53 AM11/10/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pylons-discuss
Hi, I'm having trouble setting session_expires in the login
controller, via a "remember me" option in the login form.
I first tried this:
if remember_me:
session.cookie_expires = timedelta(days=90)
else:
session.cookie_expires = True
session.save()
However, when testing by logging in and then closing the browser, the
session expired, so the above code didn't work.
I then tried:
if remember_me:
session['cookie_expires'] = timedelta(days=90)
else:
session['cookie_expires'] = True
session.save()
then, in my _before__ method in my base controller:
session.cookie_expires = session.get('cookie_expires', True)
Unfortunately this didn't work either. Has anyone else tried to
implement this ?