We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44231
    • 126 Posts
    hi guys,

    I just wanna ask if I can use the session used by the manager when admin logged in to modx dashboard?

    I will use it as a verification to open some pages

    for example:

    Resource 1 will not be open unless the $_SESSION['themodxsessionmanager'] is set

    I hope you Understand what I am saying laugh

    thanks a lot!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You should check for a context of 'mgr' in the Session.

      You can use hasSessionContext('mgr') in code. I'm not sure if there is a user output modifier for this.

      Yes, there is
      [[+modx.user.id:isloggedin=`mgr`]] 

      This will return a 1 (or true) if the user is a manager user. So you would use it like this:
      [[+modx.user.id:isloggedin=`mgr`:then=`whatever you want`]] 
      [ed. note: sottwell last edited this post 12 years, 1 month ago.]
        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