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');
        }
    }
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');
        }
    }
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' ) ; } }
Logout all active authentication tokens

@return void
@throws Exception
@throws \Neos\Flow\Session\Exception\SessionNotStartedException
Logout all active authentication tokens