Mar 17, 2016
0
Level 1
CSRF Token mismatch on Ajax Form on change submission.
I have a public form where it sends Ajax request on jquery onchange event, sometimes due to the number of requests sent in the time interval I'm starting to get TokenMismatchException.
What would be the solution to my situation? Extending the csrf token lifetime? Thoughts?
I'm using the following way to send the csrf token:
$.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } });
Please or to participate in this conversation.