I have an open form where it sends an Ajax request to the jquery onchange event, sometimes due to the number of requests sent in a period of time, I start getting a TokenMismatchException.
I use the following method to send the csrf token:
$.ajaxSetup({
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }
});
What will be the solution to my situation? Extending the life of csrf tokens? Thoughts?
source
share