I do not understand how, but the retention of cook was broken. In the frontend stopped working. What to pay attention until I realized. Someone that can advise how to catch the error.
I noticed it here as I Have not worked with ajax requests. Began to dig. Yii2 csrf saves in cookies which then compares when prompted. he was not saved and it starts to generate a new one. at this point do not converge csrf and ajax falls
Put the code in order to see if it operates retention. But saving didn't work. In the backend everything is fine
$cookies = Yii::$app->response->cookies;
'name' => 'test',
'value' => 'test',