We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38669
    • 51 Posts
    Hey all,

    MODX Revolution 2.2.1-pl, standard login package.

    User logs in fine. Logout, which redirects to home.html?service=logout, works and they appear logged out i.e. menu changes back to login (from "my account")

    However $modx->user->get('id') is still set to a value > 0.

    I notice in the login package it uses $modx->user->hasSessionContext($modx->context->get('key')) which is false when not logged in and I am changing a couple of snippets to use that.

    But why does user->get('id') still have a value, or was I using it incorrectly? [ed. note: xxxmicrobexxx last edited this post 10 years, 10 months ago.]
    • Are you logged in as a Manager user when doing this? That can cause some oddities in dealing with users.
        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
        • 38669
        • 51 Posts
        Ahhh.. I log in and log out but am logged in the back end I think. DOH! That should have been obvious.

        I'll test later. Thanks for the suggestion...I am almost sure that is what is going on.

        Quote from: sottwell at Jun 11, 2013, 06:49 AM
        Are you logged in as a Manager user when doing this? That can cause some oddities in dealing with users.
          • 38669
          • 51 Posts
          Yep, that was it...sigh...I spent ages trying to sort out what was going on. Thanks for the suggestion.