GET request (no JSON) Can't verify CSRF token authenticity with Devise 3.2.4 on Rails 4.1

后端 未结 1 512
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-15 03:04

All I a sudden I can no longer login to my app production environment on heroku. Or, if I do get in, as soon as I click a new link I get redirected to the login screen where

1条回答
  •  迷失自我
    2021-01-15 03:10

    I think the csrf token is being generated in one dyno and the next http request is hitting the second dyno, so the csrf token doesn't match. The csrf token needs saving to a database so it can be shared by both dynos. Try writing out $DYNO when the page is served and when the form is processed. This will show you which dyno is processing the csrf token and whether it is the same dyno or a different one.

    0 讨论(0)
提交回复
热议问题