ruby on rails - Can't verify CSRF token even though it's being send to server -
i'm getting error message: can't verify csrf token authenticity
although when in log can see client did send token server.
i, [2015-05-31t16:40:28.832719 #30768] info -- : parameters: {"utf8"=>"✓", "authenticity_token"=>"e1gjdum3lomswskjkg72hjjz7fq5bowcegwaauq5b48=", "company"=>{"work_time_start"=>"8", "work_time_end"=>"18", "time_rounding"=>"15", "weekends"=>"6,0", "overlap"=>"1", "week_start"=>"1", "currency"=>"usd", "number_format"=>"12,345.00", "date_format"=>"mm/dd/yyyy", "time_format"=>"12-hour (06:00 pm)"}, "commit"=>"save"} w, [2015-05-31t16:40:28.833604 #30768] warn -- : can't verify csrf token authenticity i, [2015-05-31t16:40:28.837829 #30768] info -- : completed 422 unprocessable entity in 5ms (activerecord: 0.0ms)
when @ html sent client see exact same token:
in simple form part:
<input name="authenticity_token" type="hidden" value="e1gjdum3lomswskjkg72hjjz7fq5bowcegwaauq5b48=" />
and in meta data:
<meta content="authenticity_token" name="csrf-param" /> <meta content="e1gjdum3lomswskjkg72hjjz7fq5bowcegwaauq5b48=" name="csrf-token" />
why server refusing token?
edit: have <%= csrf_meta_tag %> in layout. can see above, token being send post request, token present in client , send request. same token sent server (see second part of explanation).
edit2: more info: tried in firefox , there works. after tried in-private session in ie, , there works too. there seems cookie that's blocking something.
i know sounds pathetic, after solid hour struggling restarted computer , working ¯_(ツ)_/¯.
Comments
Post a Comment