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

Issues with Rails 5.2.2 #14

Open
dyerc opened this issue Feb 2, 2019 · 3 comments
Open

Issues with Rails 5.2.2 #14

dyerc opened this issue Feb 2, 2019 · 3 comments

Comments

@dyerc
Copy link

dyerc commented Feb 2, 2019

In a brand new Rails 5.2.2 app attempting to communicate with a Phoenix 1.4.0 (Cowboy 2.7.0) app I was unable to get this plug to work. After double and triple checking I had the correct environment variables I started to try and figure out where the problem might be.

In message_verifier.ex the verify function looks like it attempts to split a cookie value of something like abcdefgh--abcdef(2 segments). However mine had 3 segments, eg. abcdefgh--abcdef--abcdef.

I downgraded to Rails 5.0.0 and everything immediately started working so I'm guessing it must be a problem with the latest Rails version.

Has anyone else experienced the same issue?

@dyerc
Copy link
Author

dyerc commented Feb 2, 2019

After further investigation the problem for me is only present in Rails >= 5.2.

5.0.x and 5.1.x all seem to work fine.

@cconstantin
Copy link
Owner

I will have to take a look at the changes in 5.2, things like rails/rails#28132

I'll try to find some time by end of week

@cconstantin
Copy link
Owner

@CD1212 Temporary fix for Rails 5.2 is to set Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = false. I have a branch with support for AEAD encryption (default in Rails 5.2), but it fails to decrypt a session cookie generated by a new Rails 5.2. I'm not sure what I'm doing wrong, I'll get back to it later in the week. If anyone can review the code, a fresh pair of eyes might spot the issue: #15

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