public function revokeSession()
    {
        try {
            // Only show this flash if there are users in the system.
            // Not when we're about to get redirected to the "first users" screen.
            if ($this->getRepositoryUsers()->count() > 0) {
                $this->flashLogger->info(Trans::__('general.phrase.access-denied-logged-out'));
            }
        } catch (TableNotFoundException $e) {
            // If we have no table, then we definitely have no users
        }

        // Remove all auth tokens when logging off a user
        if ($sessionAuth = $this->session->get('authentication')) {
            try {
                $this->getRepositoryAuthtoken()->deleteTokens($sessionAuth->getUser()->getId());
            } catch (TableNotFoundException $e) {
                // Database tables have been dropped
            } catch (InvalidFieldNameException $e) {
                // Database tables need updating
            } catch (DriverException $e) {
                // Database tables need updating
            }
        }

        $this->session->remove('authentication');
        $this->session->migrate(true, 0);

        return false;
    }
public function revokeSession()
    {
        try {
            // Only show this flash if there are users in the system.
            // Not when we're about to get redirected to the "first users" screen.
            if ($this->getRepositoryUsers()->count() > 0) {
                $this->flashLogger->info(Trans::__('general.phrase.access-denied-logged-out'));
            }
        } catch (TableNotFoundException $e) {
            // If we have no table, then we definitely have no users
        }

        // Remove all auth tokens when logging off a user
        if ($sessionAuth = $this->session->get('authentication')) {
            try {
                $this->getRepositoryAuthtoken()->deleteTokens($sessionAuth->getUser()->getId());
            } catch (TableNotFoundException $e) {
                // Database tables have been dropped
            } catch (InvalidFieldNameException $e) {
                // Database tables need updating
            } catch (DriverException $e) {
                // Database tables need updating
            }
        }

        $this->session->remove('authentication');
        $this->session->migrate(true, 0);

        return false;
    }
public function revokeSession ( ) { try { // Only show this flash if there are users in the system. // Not when we're about to get redirected to the "first users" screen. if ( $ this -> getRepositoryUsers ( ) -> count ( ) > 0 ) { $ this -> flashLogger -> info ( Trans :: __ ( 'general.phrase.access-denied-logged-out' ) ) ; } } catch ( TableNotFoundException $ e ) { // If we have no table, then we definitely have no users } // Remove all auth tokens when logging off a user if ( $ sessionAuth = $ this -> session -> get ( 'authentication' ) ) { try { $ this -> getRepositoryAuthtoken ( ) -> deleteTokens ( $ sessionAuth -> getUser ( ) -> getId ( ) ) ; } catch ( TableNotFoundException $ e ) { // Database tables have been dropped } catch ( InvalidFieldNameException $ e ) { // Database tables need updating } catch ( DriverException $ e ) { // Database tables need updating } } $ this -> session -> remove ( 'authentication' ) ; $ this -> session -> migrate ( true , 0 ) ; return false ; }
Log out the currently logged in user.

@return bool
Log out the currently logged in user .