public function logout() { // load the authentication manager and try to authenticate this request /** @var \AppserverIo\Appserver\ServletEngine\Authentication\AuthenticationManagerInterface $authenticationManager */ if ($authenticationManager = $this->getAuthenticationManager()) { // try to load the authentication managers default authenticator if (($authenticator = $authenticationManager->getAuthenticator()) == null) { throw new ServletException('Can\'t find default authenticator'); } // logout the actual user $authenticator->logout($this); } }