After upgrading our application to Rails 6 and using all of the default configuration settings (which include per-form CSRF tokens), I'm seeing that sometimes users receive ActionController::InvalidAuthenticityToken
, however the form has the authenticity_token
in its params when looking at the stack trace, it's just different than the session's _csrf_token
attribute at the time. I can't reproduce it myself, but it's happening enough in our error monitoring tool that I'd like to correct it.
We aren't doing anything custom with the session configuration (as a matter of fact, we aren't doing any initializer for sessions at all), so I'm curious what would cause the session's token to not match the form's?