0 votes
in CodeIgniter by
Explain how you can prevent CodeIgniter from CSRF?

1 Answer

0 votes
by

There are several ways to protect CodeIgniter from CSRF, one way of doing is to use a hidden field in each form on the website.  This hidden field is referred as CSRF token; it is nothing but a random value that alters with each HTTP request sent. As soon as it is inserted in the website forms, it gets saved in the user’s session as well.  So, when the form is submitted by the users, the website checks whether it is the same as the one saved in the session. If it is same then, the request is legitimate.

Related questions

0 votes
asked Dec 28, 2020 in CodeIgniter by SakshiSharma
0 votes
asked Dec 27, 2020 in CodeIgniter by SakshiSharma
...