Jnr PHP/Codeigniter Developer Question:
Download Questions PDF

Tell me how you can prevent CodeIgniter from CSRF?

Answer:

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.

Download Jnr PHP/Codeigniter Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me how we can get the number of elements in an array?Tell me what are the main error types in PHP and how do they differ?