protected function doVerifyCookies() { $cookies = HttpHelper::getCookies(); $user = NULL; try { $user = new User($cookies['username'], $cookies['passhash']); } catch (Exception $e) { } if (!$user || !$this->checkUserValidity($user)) { $this->status = self::REDIRECTING; HttpHelper::unsetCookies(); HttpHelper::redirect('/'); // exits script return false; } $this->user = $user; $this->status = self::LOGGED_IN; return true; }