In yii2 broke cookie. In fontende don't work and backend work. What to do?

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;
$cookies->add(new Cookie([
'name' => 'test',
'value' => 'test',
June 10th 19 at 14:20
0 answer

Find more questions by tags HTTP CookiesYii