I read this tutorial which gives a nice explanation to prevent CSRF but it is still going out from my brain. According to this tutorial in method one they are including a random token with each request. So in the form they have included something like this:
<input type="hidden" name="<?php echo $token_id; ?>" value="<?php echo $token_value; ?>"
and after submitting the form they are checking for whether the token is matching or not.
How is it helping in preventing CSRF?
I am confused when the attacker sends a malicious link to a user, and when the user clicks on it then according to me the token will match everytime.