Attempts to log off the user.

@return RedirectResponse
485362
public function destroy()
    {
        try {
            $this->dispatch(new PerformUserLogout());
            return redirect($this->config->get('authentication.logout.redirectUri'));
        } catch (SessionHasExpired $e) {
            return redirect()->route('authentication::session.create')->withErrors([
               'authentication::login_warning' => $e->getMessage()
           ]);
        }
    }
628742
public function logoutAction()
    {
        $possibleRedirectionUri = $this->backendRedirectionService->getAfterLogoutRedirectionUri($this->request);
        parent::logoutAction();
        switch ($this->request->getFormat()) {
            case 'json':
                $this->view->assign('value', ['success' => true]);
            break;
            default:
                if ($possibleRedirectionUri !== null) {
                    $this->redirectToUri($possibleRedirectionUri);
                }
                $this->addFlashMessage('Successfully logged out', 'Logged out', Message::SEVERITY_NOTICE, [], 1318421560);
                $this->redirect('index');
        }
    }
473758
public function logoutAction()
    {
        $auth = $this->getServiceLocator()->get('Zend\Authentication\AuthenticationService');
        if ($auth->hasIdentity()) {
            $auth->clearIdentity();
            $sessionManager = new SessionManager();
            $sessionManager->forgetMe();
        }

        return $this->redirect()->toRoute($this->getOptions()->getLogoutRedirectRoute());
    }
107074
public function onStopImpersonating()
    {
        if (!Auth::isImpersonator()) {
            return $this->onLogout();
        }

        Auth::stopImpersonate();

        $url = post('redirect', Request::fullUrl());

        Flash::success(Lang::get('rainlab.user::lang.session.stop_impersonate_success'));

        return Redirect::to($url);
    }
19452
public function logout()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);

        if ($oUser->logout()) {
            $this->setLoginStatus(USER_LOGOUT);

            // finalizing ..
            $this->_afterLogout();

            $this->resetPermissions();

            if ($this->getParent()->isEnabledPrivateSales()) {
                return 'account';
            }

            // redirecting if user logs out in SSL mode
            if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('redirect') && $myConfig->getConfigParam('sSSLShopURL')) {
                \OxidEsales\Eshop\Core\Registry::getUtils()->redirect($this->_getLogoutLink());
            }
        }
    }
733037
public function endMaintenanceAction()
    {
        //the current ip must be whitelisted so it can access the the plateform when it's under maintenance
        MaintenanceHandler::disableMaintenance();
        $this->ipwlm->removeIP($_SERVER['REMOTE_ADDR']);
        return new RedirectResponse($this->router->generate('claro_admin_parameters_index'));
    }
1047657
public function redirect()
    {
        $this->request->getSession()->set(
            'oauth.temp', $temp = $this->server->getTemporaryCredentials()
        );

        return new RedirectResponse($this->server->getAuthorizationUrl($temp));
    }
937512
public function logout()
	{
		// check parameters and set defaults
		if (!isset($this->options['post_url'])) {
			$this->status['error'][] = 'Fatal programming error : no post_url!';
		} else {
			// prevent user error by not supplying trailing backslash.
			// make sure that when parameters are sent we do not add a backslash
			if (strpos($this->options['post_url'], '?') === false) {
				if (!(substr($this->options['post_url'], -1) == '/')) {
					$this->options['post_url'] = $this->options['post_url'] . '/';
				}
			}
			$this->ch = curl_init();
			$ip = $_SERVER['REMOTE_ADDR'];
			curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('REMOTE_ADDR: ' . $ip, 'X_FORWARDED_FOR: ' . $ip));
			curl_setopt($this->ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
			curl_setopt($this->ch, CURLOPT_REFERER, '');
			curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
			curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->options['verifyhost']);
			curl_setopt($this->ch, CURLOPT_FAILONERROR, 1);
			curl_setopt($this->ch, CURLOPT_HEADERFUNCTION, array($this, 'readHeader'));
			curl_setopt($this->ch, CURLOPT_URL, $this->options['post_url']);
			curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($this->ch, CURLOPT_VERBOSE, $this->options['debug']); // Display communication with server

			if (!empty($this->options['httpauth'])) {
				curl_setopt($this->ch, CURLOPT_USERPWD, $this->options['httpauth_username'] . ':' . $this->options['httpauth_password']);

				switch ($this->options['httpauth']) {
					case "basic":
						$this->options['httpauth'] = CURLAUTH_BASIC;
						break;
					case "gssnegotiate":
						$this->options['httpauth'] = CURLAUTH_GSSNEGOTIATE;
						break;
					case "digest":
						$this->options['httpauth'] = CURLAUTH_DIGEST;
						break;
					case "ntlm":
						$this->options['httpauth'] = CURLAUTH_NTLM;
						break;
					case "anysafe":
						$this->options['httpauth'] = CURLAUTH_ANYSAFE;
						break;
					case "any":
					default:
						$this->options['httpauth'] = CURLAUTH_ANY;
				}

				curl_setopt($this->ch, CURLOPT_HTTPAUTH, $this->options['httpauth']);
			}

			$remotedata = curl_exec($this->ch);
			if ($this->options['debug']) {
				$this->status['cURL']['data'][] = $remotedata;
				$this->status['debug'][] = 'CURL_INFO: ' . print_r(curl_getinfo($this->ch), true);
			}
			if (curl_error($this->ch)) {
				$this->status['error'][] = static::_('CURL_ERROR_MSG') . ': ' . curl_error($this->ch);
			} else {
				//we have to delete the cookies now
				$this->deleteCookies($this->options['cookiedomain'], $this->options['cookiepath'], $this->options['leavealone'], $this->options['secure'], $this->options['httponly']);
			}
			curl_close($this->ch);
		}
		return $this->status;
	}
713842
public function onLogout()
    {
        $user = Auth::getUser();

        Auth::logout();

        if ($user) {
            Event::fire('rainlab.user.logout', [$user]);
        }

        $url = post('redirect', Request::fullUrl());

        Flash::success(Lang::get('rainlab.user::lang.session.logout'));

        return Redirect::to($url);
    }
731877
public function logout() : Response
    {
        if ($this->userData->isLoggedIn()) {
            $this->userData->logOut();
        }

        return $this->response(['Logged Out']);
    }
1216940
def logout():
    "  "
    users.logout()
    return redirect(request.referrer or url_for(users._login_manager.login_view))
973967
public function logout()
    {
        if (is_null($userId = $this->getUserId())) {
            return null;
        }

        return $this->leave(static::USER_PREFIX . $userId);
    }
626052
public function authenticated()
    {
        $user = $this->Auth->identify();
        if ($user) {
            $this->Auth->setUser($user);

            $this->dispatchEvent('HybridAuth.login', ['user' => $user]);

            return $this->redirect($this->Auth->redirectUrl());
        }

        return $this->redirect($this->Auth->config('loginAction'));
    }
747105
public function logout()
    {
        $this->hook('logout');

        $this->model->unload();

        // maybe can use $this->app->destroySession() here instead?
        $this->forget('info');
        $this->forget('id');

        setcookie(session_name(), '', time() - 42000, '/');
        if (session_status() === PHP_SESSION_ACTIVE) {
            session_destroy();
        }

        $this->info = false;

        return $this;
    }
1259198
public function actionLogout()
    {
        $event = $this->getUserEvent(\Yii::$app->user->identity);

        $this->trigger(self::EVENT_BEFORE_LOGOUT, $event);

        \Yii::$app->getUser()->logout();

        $this->trigger(self::EVENT_AFTER_LOGOUT, $event);

        \Yii::$app->getResponse()->redirect(Url::to([\Yii::$app->getHomeUrl()]));
    }
1038827
public function redirect() : ?RedirectResponse
    {
        if (!$this->enabled()) {
            return null;
        }

        return redirect()
            ->back()
            ->withErrors([
                'form-verify-error' => $this->redirectMessage,
            ])
            ->withInput();
    }
1010371
public function logout()
    {
        $authService = $this->getServiceManager()->get('zfcuser_auth_service');
        $user = $authService->getIdentity();

        $cookie = explode("\n", $this->getRememberMeService()->getCookie());

        if ($cookie[0] !== '' && $user !== null) {
            $this->getRememberMeService()->removeSerie($user->getId(), $cookie[1]);
            $this->getRememberMeService()->removeCookie();
        }
    }