D
D
Danil Valiulin2015-03-03 13:00:57
Django
Danil Valiulin, 2015-03-03 13:00:57

Why is CSRF-token not written to cookies?

Good afternoon!
Before that, I was sitting on a laptop with Linux, and because. sessions were not deleted, there was no problem, but yesterday I moved to my home computer and immediately got an error:

Forbidden <span>(403)</span>
CSRF verification failed. Request aborted.

Reason given for failure:
CSRF cookie not set.

Angular says:
app.config(['$httpProvider', function($httpProvider) {
  $httpProvider.defaults.xsrfCookieName = 'csrftoken';
    $httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
}]);

In setting.py 'django.middleware.csrf.CsrfViewMiddleware'it is also registered.
Tell me how to fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2015-03-03
@SagePtr

Because in this case, the whole point of the CSRF token will be lost.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question