Last active
October 6, 2021 17:12
-
-
Save killthekitten/b9a7b11530c44e788a31ec53e5ef0dad to your computer and use it in GitHub Desktop.
Persistent CSRF token cookie
@rshipp thanks for this! Did this workaround resolve your issue with CSRF though?
It did! We just got the invalid base64
crash until we also fixed the urlsafe issue. Now our forms are all working perfectly across rails server restarts, which was failing without this csrf cookie fix.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for this! for anyone else stumbling across it, a small change:
allows it to work (tested with Rails 6) when urlsafe_csrf_tokens are enabled, instead of raising an
ArgumentError
withinvalid base64
if your existing token happens to contain the urlsafe-base64 underscore_
or dash-
characters.