public function logout()
{
if (($session = $this->getSession()) === null) {
throw new TConfigurationException('authmanager_session_required');
}
$this->getApplication()->getUser()->setIsGuest(true);
$session->destroy();
if ($this->getAllowAutoLogin()) {
$cookie = new THttpCookie($this->getUserKey(), '');
$this->getResponse()->getCookies()->add($cookie);
}
}