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++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -