Skip to content

MediumConceptPractical web security

How do you prevent CSRF in a cookie-based app?

What a good answer covers

Use SameSite cookies, anti-CSRF tokens on state-changing requests, check the Origin header and avoid state changes on GET.

More on Practical web security

Flashcards for this topic