public function testAction() { $user = new Models\Login(); $authIdentity = $user->getAuthIdentity(); if (!$authIdentity && ($tokenString = $this->cookies->get('realm')->getValue())) { if ($user->loginByCookie($tokenString)) { } else { $this->cookies->delete('realm'); } } }