We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7858
    • 97 Posts
    Hi, somehow I can not access a user, that is logged in via frontend in my custom processor.

    I login a user with

    $modx->user->addSessionContext('web');


    And if I check via frontend, the user is logged in. I can access user object, get id, username etc.

    But if I try to access user via processor

    $this->modx->user->get('id');


    i become anonymus user with id 0 etc.

    The processor is working in 'web' context. At least,

    $this->modx->context->get('key');


    returns 'web'. But I've tryed to login user to both 'web' and 'mgr' contexts - same results.

    On other hand, if there is a user logged in into manager, my processor returns this manager user, not depending if there is a user logged in in frontend.

    How can I access a frontend user in processor? Thx.
      • 3749
      • 24,544 Posts
      It sounds like this is you're own processor. How are you calling it (runProcessor(), via your own connector, via the MODX connector)?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting