We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Another issue that I can’t seem to work out.

    I’ve got the Login snippet working on a resource id 18 and once a user successfully logins it is then redirected to another page - latest news id 13. There is a separate menu specifically for those resources in this restricted area.

    At present the only way I can get users to log out is to return them back via a link ’Sign Out’ to the resource id 18 where the Login snippet resides where they can then logout. What I would prefer is for the ’Sign Out’ which is available on each page of the restricted area be the actual logout.

    I have tried using a &tplType=`modChunk` &logoutTpl=`signOut` but whilst it works in so far as it takes me out of the restricted pages it doesn’t actually log me out.

    Suggests please. smiley
      Helen Warner
      Number one pixel!
      Proud to be linked with MODX at Crimson Pixel
      • 12596
      • 16 Posts
      You can use this construction to logout user by the link:

      <a href="[[~yourpageid]]&service=logout">Logout</a>
      • That doesn’t work, it simply takes me to the page where the login snippet is held and then you have to logout there. What I actually want is the LogOut option to be availalbe in a side bar on all the private pages so that a user can immediately log out without having to go to a specific page to log out.

        Does that make sense! huh

        I’m also looking for automatic log out or a way of logging someone out if the account is inactive for a period of time.

        Any other suggestions?
          Helen Warner
          Number one pixel!
          Proud to be linked with MODX at Crimson Pixel
        • Ok, managed to get this one working as Ibobriakov posted, the only difference was that I seemed to state in the login call &actionKey. The call on my login page [[~28]] is as follows:

          [[!Login? &tplType=`modChunk` &loginTpl=`myLogin` &logoutTpl=`myLogout` &loginResourceId=`13` &logoutResourceId=`18` &actionKey=`service`]]

          Whilst the &actionKey defaults to service, it didn’t seem to work unless I actually set it.

          Then I put the call for the logout as follows:

          <a href="[[~28]]&service=logout" >Sign out</a>

          Hope this helps another perplexed individual! wink

          Oh yes, and when you’ve made these changes its worth clearing the cache and flushing permissions too...
            Helen Warner
            Number one pixel!
            Proud to be linked with MODX at Crimson Pixel