Logouts the logged in user

@access public
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response
425919
public function logoutUser(WebRequest $request, Response $response)
    {
        $this->cleanupSession($request);
        
        $request->removeSession();
    }
513868
public function startAuthentication(Request $request, Response $response)
    {
        $response->setStatus(401);
        $response->setHeader('WWW-Authenticate', 'Basic realm="' . (isset($this->options['realm']) ? $this->options['realm'] : sha1(FLOW_PATH_ROOT)) . '"');
        $response->setContent('Authorization required');
    }
1043586
private function authenticate(Request $request, Response $response)
    {
        $authenticationProvider = $this->injector->getInstance(AuthenticationProvider::class);
        try {
            $user = $authenticationProvider->authenticate($request);
            if (null == $user && $this->authConstraint->loginAllowed()) {
                $response->redirect($authenticationProvider->loginUri($request));
            } elseif (null == $user) {
                // TODO should become 401 Unauthorized
                // see https://github.com/stubbles/stubbles-webapp-core/issues/73
                $this->error = $response->forbidden();
                return null;
            }

            return $user;
        } catch (AuthProviderException $ahe) {
            $this->handleAuthProviderException($ahe, $response);
            return null;
        }
    }
731877
public function logout() : Response
    {
        if ($this->userData->isLoggedIn()) {
            $this->userData->logOut();
        }

        return $this->response(['Logged Out']);
    }
530173
public function run(Request $request, Response $response)
    {
        $this["logger.service"]("System")->info("Beginning process for request.", [$request]);

        $this->setRequestProperties($request);

        $result = $this["hooks.service"]->exec(
            "application.dispatch.before",
            $request,
            $response,
            $this
        );
        if ($result === "exit"
            || (is_array($result) && in_array("exit", $result))) {
            return;
        }

        // record the time before execution
        $start = microtime(true);

        // dispatch request
        try {
            $this["routeDispatcher.service"]->dispatch($request, $response, $this);
        } catch (RouteNotFoundException $routeNotFound) {
            $this["logger.service"]("System")->error("No Route found for Request");
            $this["logger.service"]("System")->debug(
                "No Route Found Debug Information",
                ["exception" => $routeNotFound]
            );

            $response->setStatusCode(404);
            $response->setContent($this->load404Page());
            throw $routeNotFound;
        }

        $this["logger.service"]("System")->info(
            "Request has finished processing, Response is ready to be sent to "
            . "caller."
        );

        $this["hooks.service"]->exec("application.dispatch.after");

        // record the time after execution
        $end = microtime(true);
        $this["logger.service"]("System")->debug(
            "Time taken to finish Request processing",
            [
                "start"     =>  $start,
                "end"       =>  $end,
                "elapsed"   =>  $end - $start,
                "uri"       =>  $request->getRequestUri()
            ]
        );
    }
2593
public function terminate(SymfonyRequest $request, SymfonyResponse $response)
	{
		$this->callFinishCallbacks($request, $response);

		$this->shutdown();
	}
154649
public function logout()
	{
		// Build the request path.
		$path = '?action=login';

		// @todo clear internal data as well

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}
1362466
public function log(Request $request, Response $response): void
    {
        $host = $request->url();
        $method = $request->method();
        $agent = $request->userAgent();
        $date = $this->date($response->getDate());
        $status = $response->status();
        $style = $this->style($status);

        $this->output->writeln(
            sprintf("%s %s %s <$style>%d</$style> %s", $host, $date, $method, $status, $agent)
        );
    }
1249315
public function logout(ResponseInterface $response, $destination = '/')
    {
        // Make sure we're making request with the authorization_code grant.
        $this->asUser();

        $this->getFrameworkBridge()->logout();

        $destination = $this->getFrameworkBridge()->prepareUrl($destination);
        $ssoLogoutUrl = config('services.northstar.url').'/logout?redirect='.$destination;

        return $response->withStatus(302)->withHeader('Location', $ssoLogoutUrl);
    }
825292
public function logout(Request $request): JsonResponse
    {
        /** @var HCUser $user */
        $user = $request->user();
        $user->updateLastActivity();
        $user->token()->revoke();

        return $this->response->success(trans('HCCore::users.message.logged_out'));
    }
346708
public function handleResponse(Response $response) : void
    {
        if ($this->id === null) {
            // The request was not associated with an existing session, and no session writes occurred.
            // Sending a session cookie is unnecessary.
            return;
        }

        // Note: we re-send the session cookie even if it was part of the request, to refresh the expiration time.

        $this->writeSessionId($response);
        $this->reset();
    }
76675
protected function sendResetResponse(Request $request, $response)
    {
        if ($request->expectsJson()) {
            return response()->json([
                'status' => trans($response)
            ]);
        }
        return redirect($this->redirectPath())
            ->with('status', trans($response));
    }
27177
public function loginRequired($redirect_url, $request = null, $response = null)
    {
        if ($this->isSingle()) {
            User::loginRequired($redirect_url, $request, $response);
        }
    }
175152
public function terminate(Request $request, Response $response)
    {
        $this->settings->save();

        $unused = compact('request', 'response');
        unset($unused);
    }
638943
public function logout($request)
	{
		// check Signature
		if(!$this->checkSignature($request)){
			// Redirect to LoginView
			$this->toLogin($callback,$appId);
		}
		$this->deleteTicket();
		// Redirect to LoginView
		$this->toLogin($callback,$appId);
	}
512901
public function validateLogoutResponse(LogoutResponse $response)
    {
        $this->validateIssuer($response);

        if ($this->hasSignature($response)) {
            $this->validateSignature(
                $response,
                KeyHelper::createPublicKey(
                    $this->getMetadata()->getFirstIdpSsoDescriptor()
                        ->getFirstKeyDescriptor(KeyDescriptor::USE_SIGNING)
                        ->getCertificate()
                )
            );
        }
    }
666951
public function logout(Request $request)
    {
        $event = new AccessControlEvent($request);
        /** @var Token $sessionAuth */
        $sessionAuth = $this->session()->get('authentication');
        $userId = $sessionAuth ? $sessionAuth->getToken()->getUserId() : false;
        if ($userId && $sessionAuth->getUser()) {
            $userName = $sessionAuth->getUser()->getUsername();
            $this->app['logger.system']->info('Logged out: ' . $userName, ['event' => 'authentication']);
            $event->setUserName($userName);
        }
        $this->app['dispatcher']->dispatch(AccessControlEvents::LOGOUT_SUCCESS, $event);

        // Clear the session
        $this->accessControl()->revokeSession();
        $this->session()->invalidate(-1);

        // Clear cookie data
        $response = $this->redirectToRoute('login');
        $response->headers->clearCookie(
            $this->app['token.authentication.name'],
            $request->getBasePath(),
            $this->getOption('general/cookies_domain'),
            $this->getOption('general/enforce_ssl')
        );

        return $response;
    }