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

Devise: Reset session on log out #91

Closed
joshmcarthur opened this issue May 15, 2020 · 0 comments · Fixed by #96
Closed

Devise: Reset session on log out #91

joshmcarthur opened this issue May 15, 2020 · 0 comments · Fixed by #96
Assignees

Comments

@joshmcarthur
Copy link
Contributor

Rials by default keeps a persistent session that the request/response cycle can add session data to. In order to make sure that we do not retain potential user data (outside of the warden user ID) in cookies, we should reset the session when the user logs out.

This will cause the entire session to be reset.

@eoinkelly eoinkelly self-assigned this Jun 3, 2020
eoinkelly added a commit that referenced this issue Jun 3, 2020
The default devise behaviour does not invalidate session cookies after logout
so if an attacker can retrieve a cookie from a session they can use it
even if the user has logged out.

We have used variations of this change successfully on a number of Rails
apps in production.

References

* heartcombo/devise#3031
* http://maverickblogging.com/logout-is-broken-by-default-ruby-on-rails-web-applications/
* https://makandracards.com/makandra/53562-devise-invalidating-all-sessions-for-a-user

Fixes #91
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

Successfully merging a pull request may close this issue.

2 participants