Answer the question
In order to leave comments, you need to log in
Why is csrf cookie not always created in yii2?
The problem is that when I clear cookies, the csrf of the cookie is not saved, but if I switch to the standard layout, the cookie is saved and then I switch to my layout and everything works.
I've added the csrf meta.
Layout files are the same.
Php-7
OpenServer
Mongodb
What could be the problem? thank.
Answer the question
In order to leave comments, you need to log in
such a problem may arise due to the absence of $this->beginPage() in the layout or the output of csrf meta tags <?= Html::csrfMetaTags() ?>
Isn't the CSRF Token stored in the session?
According to the rules of CSRF, the Token is stored in the session, and every time the pages are updated, it changes the key.
Link Yii2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question