1👍
In Django, I renamed one of my csrftoken to be custom-csrftoken
using CSRF_COOKIE_NAME
. In my front end too, i renamed my csrftoken to be custom-csrftoken
.
If the above approach still doesn’t work, then it means x-csrftoken header is not being sent in req headers. Try setting
CSRF_COOKIE_HTTPONLY = False
in django, then X-CSRFToken header will be included in request headers from front end. So There are no more conflicts
This approach resolved my issue.
Source:stackexchange.com