Add easy way to set session expiry #16

Closed
danjac opened this Issue Apr 26, 2010 · 2 comments

Projects

None yet

2 participants

@danjac
danjac commented Apr 26, 2010

It's quite difficult at the moment to set the expiry date for the session. Ideally something like this could work (although it might require subclassing SecureCookie):

if request.form.get('remember_me', False):
    session.expires = timedelta(days=30)
@mitsuhiko
Member

Yep, that would be nice. But because sessions setting works a little bit different (cookie is reset if information is written) the only working solution would be to store the expiration information inside the session directly.

Eg: session['max_age'] = timedelta(days=30) or session['expires'] = datetime.utcnow() + timedelta(days=30). Not sure how to decide about that, will consider something.

@mitsuhiko
Member

Added support for long running sessions. This closed by 36717b0.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment