Problem Statement
How can you protect login forms from CSRF attacks in PHP?
Explanation
You can prevent CSRF by generating a unique token stored in the session and embedding it in each login form. When the form is submitted, the server verifies that the token matches the one stored, ensuring the request is genuine.
Practice Sets
This question appears in the following practice sets:
