Essence: Yii2 removes 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 other domain names.
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' => 'секретка', ], Validation disabled because I tried to set via setcookie directly. The moment of removal could not be traced, but it comes some time after the client’s inactivity, approximately 20 minutes.
I also found out that all cookies are deleted if manually removing PHPSESSID.
все куки и сессии удаляет через некоторое время- So the session should be deleted when the browser is closed according to the idea - Yury Svetlov