Logout method

This method logs the user out and redirects to the login-page.
The login-page is chosen by the AuthComponent

@return void|\Cake\Network\Response
486316
public function logout()
    {
        $this->Flash->success(__('You are now logged out.'));
        return $this->redirect($this->Auth->logout());
    }
430013
public function logout()
    {
        if ($this->isAuthenticated() !== true) {
            return;
        }
        $this->isAuthenticated = null;
        $session = $this->sessionManager->getCurrentSession();

        /** @var $token TokenInterface */
        foreach ($this->securityContext->getAuthenticationTokens() as $token) {
            $token->setAuthenticationStatus(TokenInterface::NO_CREDENTIALS_GIVEN);
        }
        $this->emitLoggedOut();
        if ($session->isStarted()) {
            $session->destroy('Logout through AuthenticationProviderManager');
        }
    }
820564
public function logout()
    {
        $user = $this->sentry->getUser();
        $this->sentry->logout();
        $this->event->fire('users.logout',array($user));
    }
1084825
public function logout()
    {
        $user = $this->user();
        // If we have an event dispatcher instance, we can fire off the logout event
        // so any further processing can be done. This allows the developer to be
        // listening for anytime a user signs out of this application manually.
        $this->clearUserDataFromStorage();
        if (isset($this->events)) {
            $this->events->dispatch(new Logout($user));
        }
        // Once we have fired the logout event we will clear the users out of memory
        // so they are no longer available as the user is no longer considered as
        // being signed into this application and should not be available here.
        $this->user = NULL;
        $this->loggedOut = TRUE;
    }
318562
protected function buildLogout()
    {
        //Deletes some cookies and KCFinder session
        $cookies = $this->request->getCookieCollection()->remove('login')->remove('sidebar-lastmenu');
        $this->request = $this->request->withCookieCollection($cookies);
        $this->request->getSession()->delete('KCFINDER');

        return $this->redirect($this->Auth->logout());
    }
718444
public function logoutAction() {
        // never cache the logout request
        $this->_helper->cache->setNoCacheHeaders($this->getResponse());

        $auth = Garp_Auth::getInstance();
        $userData = $auth->getUserData();
        $this->_beforeLogout($userData);

        $auth->destroy();
        $authVars = $auth->getConfigValues();
        $target = '/';
        if ($authVars && !empty($authVars['logout']['successUrl'])) {
            $target = $authVars['logout']['successUrl'];
        }

        // Remove the role cookie
        if (!$auth->getStore() instanceof Garp_Store_Cookie) {
            $this->_removeRoleCookie();
        }

        $this->_afterLogout($userData);

        $flashMessenger = $this->_helper->getHelper('FlashMessenger');
        $flashMessenger->addMessage(__($authVars['logout']['successMessage']));

        $cacheBuster = 'action=logout';
        $target .= (strpos($target, '?') === false ? '?' : '&') . $cacheBuster;
        $this->_helper->viewRenderer->setNoRender(true);
        $this->_redirect($target);
    }
1175984
public function actionLogout()
    {
        Yii::$app->user->logout();

        // handle redirect
        $logoutRedirect = $this->module->logoutRedirect;
        if ($logoutRedirect) {
            return $this->redirect($logoutRedirect);
        }
        return $this->goHome();
    }
1093408
public function logoutAction()
    {
        $auth = $this->auth;
        $this->logger->info('User ' . ($auth->getUser()->getLogin()==''?$auth->getUser()->getInfo()->getDisplayName():$auth->getUser()->getLogin()) . ' logged out');
        $auth->clearIdentity();
        unset($_SESSION['HA::STORE']);

        $this->notification()->success(/*@translate*/ 'You are now logged out');
        return $this->redirect()->toRoute(
            'lang',
            array('lang' => $this->params('lang'))
        );
    }
76992
public function actionLogout()
    {
        if (!Yii::$app->adminuser->logout(false)) {
            Yii::$app->session->destroy();
        }
        
        return $this->redirect(['/admin/login/index', 'logout' => true]);
    }
1021921
public function actionLogout()
    {
        Yii::$app->user->logout();
        $back = Yii::$app->request->post('back') ?: Yii::$app->request->get('back');

        return $back ? $this->redirect($back) : $this->goHome();
    }
805922
public static function logout() {
    self::clearSession();
    $appUrlParts = parse_url(self::$config['app_url']);
    setcookie(
        'TILMELDAUTH',
        '',
        null,
        $appUrlParts['path'],
        $appUrlParts['host']
    );
  }
954881
public function logout()
    {
        $request = new Request();
        (new Cookies())->delete('user', '/', $request->getServerName());
        session_regenerate_id(); //Avoid session hijacking

        return Session::delete('user');
    }
433002
public function logout()
    {
        if ($this->_isAuthenticated && $this->_connection->connected) {
            $this->_logout();
            $this->_connection->close();
        }

        $this->_connection = $this->_selected = null;
        $this->_isAuthenticated = false;
        $this->_mode = 0;
    }
395041
private function toServerLogout()
	{
		$logoutUrl = $this->_config['logout'].$this->signature().'&appId='.$this->_config['appId'];
		header('Location:'.$logoutUrl);
	}
1207832
public function logout()
    {

        // load the authentication manager and try to authenticate this request
        /** @var \AppserverIo\Psr\Auth\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);
        }
    }
619349
public function logout() {
		$this->authProvider->logout();
		$this->authProvider = new Client\Authentication\NoAuth($this, array(), array());
		$this->changeDescription(NULL);
	}
53785
public function logout()
  {
    $this->oauth_invalidateToken([
      'access_token'        => $this->_oauth_token,
      'access_token_secret' => $this->_oauth_token_secret
    ]);

    $this->_oauth_token =
    $this->_oauth_token_secret = null;

    return true;
  }