I may be missing something obvious, but I'm having difficulty setting
the session expiration inside a controller action.  I'd like to have
it expire 20 days after login, but no matter I try to do, the
expiration of the client cookie is: 01/18/2038 02:14:07 PM

Here are the config options I'm using

beaker.session.key = session-token
beaker.session.secret = 4-8-15-16-23-42
beaker.session.cookie_expires = False
beaker.session.data_dir = /tmp/sess
beaker.session.type = file
# spans subdomains
beaker.session.cookie_domain = .mydomain.com

And in an action:

def login(self):
    session['username'] = 'chris'
    # expire in 20 days
    expires = datetime.today() + timedelta(20)
    expires = expires.strftime("%a, %d-%b-%Y %H:%M:%S GMT")
    session.cookie_expires = expires
    session.save()

I've tried a few other ways all of them breaking encapsulation
principles and none of them working :(, so what is the best way to set
the expiration date of beaker session cookies?

Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to