Customizing CSRF Protection error messages in Codeigniter

Asked

Viewed 251 times

7

In the CodeIgniter, if I give a Reload F5 on a form page, the error is returned The action you have requested is not allowed. A protection against CSRF.

How do I customize the HTML of that error message?

Instead of displaying a message HTML error, how to make me use the function redirect() and take the user to the home page?

  • 2

    I customized it this way: $this->Session->set_flashdata('error', 'You are not allowed to view closures.');

  • And below you can put a redirect... but it depends on the condition and the controller/model you are working on... If you can post them, I think it’s better to understand what exactly you need.

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.