In this tip I can explain how we can disable CSRF token in CakePHP 3. You can add this code in beforeFilter() method. This code helps you to fix CSRF Token Mismatch.
1 2 3 4 5 6 |
public function beforeFilter(Event $event) { if (in_array($this->request->getParam('action'), ['method1', 'method2'])){ $this->getEventManager()->off($this->Csrf); } } |
Hope this tip helps you.