The Beaker's session object accepts a "cookie_expires" parameter from
the system-wide config. What should I do if I want to implement
"remember me" option for per-user scope? I mean the following
behaviour:

# In development.ini the "cookie_expires" option is set to True

def authenticate(<various_credentials>, remember=False):
...
if remember:
    session.cookie_expires = expiration_date
    session.invalidate()
session[SESSION_KEY] = <user_identity>
session.save()

So, I have to call invalidate() first in order to properly set an
expiration date for the current user session. Otherwise (i.e. without
invalidate() call) the session will use the "expire_cookies=True"
mode.
It acts like a shared object and I don't even know is this a thread-
safe way to change cookie_expires? How to get it done properly?

-- 
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