Image for Anti-CSRF Tokens

Anti-CSRF Tokens

Anti-CSRF (Cross-Site Request Forgery) tokens are security measures used to protect websites from unauthorized actions. When you log in or perform sensitive tasks, the website generates a unique, unpredictable token and includes it with your requests. This token verifies that the request genuinely comes from your session and not from a malicious third-party site. If an attacker tries to trick your browser into submitting harmful requests, the absence or mismatch of this token helps the website detect and block such unauthorized actions, ensuring your data and account remain secure.