Did not quite understand the question. User passes authorization - you record the status of this connection to the session (authorized, unauthorized) And the session value itself is transmitted via a cookie - right? look at the CwebUser code
public function setState($key,$value,$defaultValue=null) { $key=$this->getStateKeyPrefix().$key; if($value===$defaultValue) unset($_SESSION[$key]); else $_SESSION[$key]=$value; }
mean saves not in the cookie but in the session, but as already told you in the answer, the session also has a lifetime. It’s just that you can store cookies longer than the session. Therefore, when entering a nasayt, the following happens: the class receives cookies, and from there it takes a session — but the session is no longer there — therefore the user is unauthorized.