我从 Rails 3 升级到 Rails4,现在我在生产中随机收到 InvalidAuthenticityToken 错误,仅针对不同的操作。我尝试过,但我无法重现它。params 哈希包含真实性令牌。
Parameters : {"utf8"=>"✓", "authenticity_token"=>"26+QxdF3aHveYkibn9DJ8Hgz6mUna2v8MOp1bnM78cg=", "session"=>{"email"=>"abc@xyz.com", "password"=>"[FILTERED]"}, "commit"=>"Sign In", "action"=>"create", "controller"=>"sessions"}
Parameters : {"_method"=>"delete", "authenticity_token"=>"uafnPb4DjEJuW9YCTP9UB5tXyGlKbZh6uXlc6MVIoG8=", "controller"=>"sessions", "action"=>"destroy"}
Parameters : {"utf8"=>"✓", "authenticity_token"=>"Nhp4VNI9XJS7yqGRgGewOJ3ilkZSwMhmceXoOsoL/fw=", "volunteer_record"=>{"activity"=>"OTHER", "note"=>"Tuned the Melody Harp -- a tricky little beast....", "hh"=>"", "mm"=>"30"}, "commit"=>"Save", "action"=>"create", "controller"=>"volunteer_records"}
任何有关如何解决此问题的线索将不胜感激。protect_from_forgery
设置with: :exception
为。