簡體   English   中英

生產中的Rails4 InvalidAuthenticityToken隨機錯誤

[英]Rails4 InvalidAuthenticityToken random error on production

我從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

運用

protect_from_forgery: :reset_session 

為我工作。 這是Rails 3中的默認值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM