0

I'm using Jeditable and jQuery (obviously) and I need to send X-CSRF-Token in every Ajax request. How can I do it?

Jeditable does not seem to support this issue. (or am I wrong?)

Termininja
  • 6,620
  • 12
  • 48
  • 49
Zbigniew Ledwoń
  • 682
  • 1
  • 6
  • 19

1 Answers1

1

My simple solution is to make JQuery include my X-CSRF-Token in every Ajax request. Just add:

$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': getCookie('myCsrfToken')
    }
});

See here for proper 'getCookie' function.

Community
  • 1
  • 1
Zbigniew Ledwoń
  • 682
  • 1
  • 6
  • 19