javascript - rails 3 CSRF token changes just before the POST request -


rails 3 , backbone.js app.

the csrf token not change until post form submitted.

as form submitted csrf token changes , "warning: can't verify csrf token authenticity"

form submitted using ajax.

i guess kind of late respond, problem caused missing withcredentials parameter of xhr requests sending backbone.js. if post request not contain session infromation, given new csrf token backend.

$.ajax({  type: "post",  xhrfields: {withcredentials: true},  //other fields }) 

Comments

Popular posts from this blog

c - sscanf() double showing zeros -

pentaho - Carte Status / Kettle Slave Server Status page shows status for random runs instead of the latest run -