Answer the question
In order to leave comments, you need to log in
How to stop Yii2 from deleting cookies?
Bottom line: Yii2 deletes all cookies and sessions after a while, although the lifetime is 3600*24*30*12 - which is confirmed when viewing cookies in the browser. Removes both PHPSESSID and any others on the domain
My config:
'session' => [
'class' => 'yii\web\Session',
'cookieParams' => ['httponly' => true, 'lifetime' => 3600*24*30*12],
'timeout' => 3600*24*30*12,
'useCookies' => true,
],
'request' => [
'enableCookieValidation' => false,
'enableCsrfValidation' => true,
'cookieValidationKey' => 'секретка',
],
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question