We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21419
    • 84 Posts
    I'm looking for a direct method to log a user out via PHP, like $modx->logOutWebUser or something along those lines. All I've been able to find is a way to log them out via URI parameters, ?webloginmode=lo. Looking for a way to do this before the page is fully parsed and loaded without changing the URI.
    • You should be able to use runProcessor('security/logout' ... )

      The Login extra uses this code:

      $response = $this->modx->runProcessor('security/logout',array(
                      'login_context' => $this->getProperty('loginContext',$this->modx->context->get('key')),
                      'add_contexts' => $this->getProperty('contexts',''),


      See core/components/login/controllers/web/Login.php, around line 346.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 21419
        • 84 Posts
        Susan, this is exactly the kind of thing I'm looking for, but runProcessor is Revo isn't it?

        Quote from: sottwell at Apr 05, 2015, 10:47 PM
        You should be able to use runProcessor('security/logout' ... )

        The Login extra uses this code:

        $response = $this->modx->runProcessor('security/logout',array(
                        'login_context' => $this->getProperty('loginContext',$this->modx->context->get('key')),
                        'add_contexts' => $this->getProperty('contexts',''),


        See core/components/login/controllers/web/Login.php, around line 346.
        • Oops... sorry, I didn't notice you were using Evo.

          See assets/snippets/weblogin/weblogin.processor.php around line 127.

          Basically, it just gets rid of the session cookie as well as the SESSION values relating to the web login.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 21419
            • 84 Posts
            Thanks, Susan. I can definitely work with that!