I
I
Ivan Komarov2017-02-01 18:38:25
Yii
Ivan Komarov, 2017-02-01 18:38:25

YII2: Why does bad Request (#400) Unable to verify your data submission occur?

When I enable Csrf tags, I get an error from the subject. I am not uploading files.
Basically layout output <?= Html::csrfMetaTags() ?> is there and everything is generated

<meta name="csrf-param" content="_csrf-frontend">
<meta name="csrf-token" content="QmcxU050NEIzD2AaDScBdxQqHAkFM04XCT9AFhZNQSlyIlISYy1yMg==">

The form is made via ActiveForm and the POST request sends
_csrf-frontend:Ukp1TC5KYUgaEBQIWwg4cCI7OCZEf1YYERJMfkIuAH84DD8ObQlTEA==
In the config
'request' => [
            'csrfParam' => '_csrf-frontend',
            'enableCsrfValidation' => true,
        ],

I read the whole Google, I did not find a solution

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question