The documentation has an explanation here, but I had some additional questions..
If Django does not use transaction specific nonces, why not just require to embed the session ID inside the POST request body?
This webpage seem to imply that CSRF nonce needs to be bound to the session ID (e.g. CSRF nonce = keyed hash of session ID). Why is that? Does Django bind its CSRF nonce to session ID?
Is it because of performance concern? Intuitively transaction specific nonces seem to be more secure by nature.
CSRF protection and session have different nature, so putting those in single cookie would make it harder to maintain.
Here are some differences:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With