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

What is the purpose of the user_credentials cookie? Why store that in a cookie and in the Rails session? #663

Closed
myers opened this issue Mar 7, 2019 · 2 comments

Comments

@myers
Copy link

myers commented Mar 7, 2019

I'm confused as to the purpose of storing user_credentials twice in cookies in a typical Rails app using Cookie based sessions. Once a user is logged there is both authlogic data in rails session cookie, which is encrypted and signed, and also in replay-attackable user_credentials cookie. Why have both? Shouldn't there be an option to turn off cookies in Authlogic?

This is coming up in a strange situation where users are missing their rails session cookie (and thus their CSRF token) but are "logged in" because of the user_credentials cookie.

Also, in digging into this I realized that we use bugsnag that it should be configured to filter our the user_credentials cookie, since they can be used to login as the given user. Perhaps the README.md needs to be updated to help folks realize what cookie's are being used and might need to be filtered out.

@myers
Copy link
Author

myers commented Mar 7, 2019

The cookie is only there when you use the remember_me feature. You can't use Rails session cookies because they are session cookies that go away when the browser is closed.

@myers myers closed this as completed Mar 7, 2019
@jaredbeck
Copy link
Collaborator

Also, in digging into this I realized that we use bugsnag that it should be configured to filter our the user_credentials cookie, since they can be used to login as the given user. Perhaps the README.md needs to be updated to help folks realize what cookie's are being used and might need to be filtered out.

Hi Myers, Such an addition to the readme would be welcome, thanks. It doesn't quite fit under section 5 "addons" so maybe a new section "integrations"?

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

2 participants