Friday, November 27, 2015

AJAX To Send CSRF Token Authenticity

AJAX To Send CSRF Token Authenticity

To send CSRF (XSRF) token authenticity in all AJAX requests:

$.ajaxSetup({
     headers: { 
 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') 
 }});

No comments:

Post a Comment