public function SaveUserIdentity(UserIdentity $identity) { $identity->encryptedPassword = $this->identityCheckStrategy->GetEncryptedPassword($identity->password); $this->sessionWrapper->setValue(self::KEY_SESSION_IDENTITY, $identity); if ($identity->persistent) { setcookie(self::KEY_REMEMBER_ME, $this->rememberMeGenerator->encode($identity), time() + self::REMEMBER_ME_LIFETIME); } }