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

Config to expire session only after some time of inactivity #785

Open
derosm2 opened this issue Apr 18, 2018 · 0 comments
Open

Config to expire session only after some time of inactivity #785

derosm2 opened this issue Apr 18, 2018 · 0 comments

Comments

@derosm2
Copy link

derosm2 commented Apr 18, 2018

I didn't see a way to do this right now but found a workaround someone had developed.

Basically they set the cookie_expiration to a short period of time, then call sign_in on any controller action. This way the user will only be logged out if they stop using the site.

This worked well for us, but it has one downside - every time a request is made, the existing CSRF token becomes invalid because rotate_csrf_on_sign_in is set to true. One example being if you have a download link on a page with a form, clicking the download will change the CSRF token and the user will not be able to submit the form.

Is it possible to update cookie_expiration manually instead of having to go through sign_in? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant