Can we change CSRF token per-form request or even per-request instead of same token for one active session?
Can we change CSRF token per-form request or even per-request instead of same token
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the csrf middleware they do something like this, which overwrites the cookie set:
You can import
_get_new_csrf_key()viafrom django.middleware.csrf import _get_new_csrf_key(). Since is kind of a private method I would advise against some hacks like this though.