I have two different apps of cakephp. One has a version 3.5 and other 3.6.
When i used and built 3.5 app i did not have a problem of CSRF matching in post requ
CSRF matching in post requ
Add this code on your $.ajax() function call:
beforeSend: function (xhr) { // Add this line xhr.setRequestHeader('X-CSRF-Token', $('[name="_csrfToken"]').val()); }, // Add this line