-
Notifications
You must be signed in to change notification settings - Fork 47
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
Session can get lost after a Devise sign in #56
Comments
thanks for the demo app, I'll check it out. |
Removing |
We're not blocked; I just wanted you to know about it. |
Thanks @BoboFraggins, I'm gonna start investigating why this occurred. Think it might have to do with some changes made to redis-store recently. |
I'm having the same issue. |
Haven't had a chance to get around to this. Pull requests welcome :) |
@tubbo I think I found the cause and a fix. At least, it fixes the demo app. I wasn't familiar with the codebase, so I started by stepping through with After reading some code in I'll open a PR soon. |
Override `extract_session_id` to get decrypted/unsigned value. https://github.com/rack/rack/blob/5ce5b2ccb151c62652e25b4711218ede11497cc3/lib/rack/session/abstract/id.rb#L318-L324 https://github.com/rack/rack/blob/5ce5b2ccb151c62652e25b4711218ede11497cc3/lib/rack/session/abstract/id.rb#L476-L479 Fixes redis-store/redis-rack#56
When upgrading the various redis-* gems recently, I ran into a problem where the contents of the session appears to get mangled when signing in via Devise. I've tried to narrow this down further, but I'm not familiar enough with the session internals to get to the bottom.
My best reproduction was creating a brand new Rails app. Add devise, redis, and redis-rails. Make a session_store initializer:
Make the ApplicationController be:
Make a root route and attempt to sign up on the website.
redis-rack: 2.1.2, redis-actionpack: 5.2.0
The authenticity token fails to match.
If you downgrade to redis-rack: 2.0.6, redis-actionpack: 5.1.0
All of the devise actions work.
I have uploaded my demo app here: https://github.com/BoboFraggins/redis-rack-error
The text was updated successfully, but these errors were encountered: