clearance icon indicating copy to clipboard operation
clearance copied to clipboard

Config to expire session only after some time of inactivity

Open derosm2 opened this issue 7 years ago • 0 comments

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!

derosm2 avatar Apr 18 '18 19:04 derosm2