Answer the question
In order to leave comments, you need to log in
Csfr yii2 stopped validating?
Good afternoon! The problem is this, csrf validation on yii2 advance has ceased.
The layout has <?php $this->beginPage() ?>
and <?= Html::csrfMetaTags() ?>.
All forms start with <?php $form = ActiveForm::begin(); ?>
, the html code has a token in both the head and the form, however, when a POST request is made, an Unable to verify your data submission error occurs. When viewing debug, the data from the form is visible, but does not pass validation. What does this problem only in the frontend, everything is fine in the backend.
Answer the question
In order to leave comments, you need to log in
Check if there was a redirect before. Whether superfluous is cached. See if there is a token in the post itself.
Check the config, namely that in
'components' => [
'request' => [
Yii::$app->getRequest()->validateCsrfToken()
and check there what is actually being checked and with what.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question