CI 4.5.1 CSRF - The action you requested is not allowed. |
Hello experts,
Has anyone encountered the same issue as mine after updating from CI4.4.5 to CI4.5.1? Submitting a form with CSRF configuration previously posed no problem. However, now I can't submit the form using ajax unless I configure it as expected in the filter. I need some routes to not be excepted in the filter (csrf->except->[]) configuration. Thank you in advance.
Hey there,
Yes, CI 4.5.1 tightened CSRF handling. To exclude routes, use csrf_exclude() in your controller: PHP $this->protectExcept(['route1', 'route2']); This allows AJAX form submissions without CSRF validation on those routes.
@BhambriRohunu Excuese me, are you a bot? Your comment is nonsense.
|
Welcome Guest, Not a member yet? Register Sign In |