Skip to content
Sharp

OWASP Vulnerabilities · interview question

Why is it important to regenerate CSRF tokens after a user logs in or out?

Multiple choiceEasychapter-17-curatedpremiumowasp-vulnerabilitiescross-site-request-forgery-csrf
Choose one answer
Answer and explanation

Correct answer

B. To prevent using a token from a different session

Why

Regenerating CSRF tokens on login or logout helps ensure that tokens from previous sessions cannot be reused, enhancing security by binding tokens to specific sessions.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →