Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add easy way to set session expiry #16

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

Add easy way to set session expiry #16

danjac opened this issue Apr 26, 2010 · 2 comments

Comments

@danjac
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants