We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15987
    • 786 Posts
    Not sure what the problem is here, but for some reason I am not able to login/logout on some pages. Here is my snippet call (this is in a chunk):

    [!WebLoginPE? &type=`simple` &loHomeId=`1` &regHomeId=`23`!]

    If I put his chunk in a non-cached page the login/logout works correctly, however if the page is cached the login works which in turn caches the page and then logout does not work.

    I am using 0.9.6 on php 4.4.7

    Thanks for any help
      • 3749
      • 24,544 Posts
      Quote from: kylej at Oct 30, 2007, 03:00 PM

      Not sure what the problem is here, but for some reason I am not able to login/logout on some pages. Here is my snippet call (this is in a chunk):

      [!WebLoginPE? &type=`simple` &loHomeId=`1` &regHomeId=`23`!]

      If I put his chunk in a non-cached page the login/logout works correctly, however if the page is cached the login works which in turn caches the page and then logout does not work.

      I am using 0.9.6 on php 4.4.7

      Thanks for any help

      I’ve had similar troubles. I think it’s a quirk of 0.9.6 that caching can get reversed from page to snippet call and (not sure about this one) from snippet to chunk. Sometimes, you have to ask for the opposite of what you want.

      Bob
        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
        • 33175
        • 711 Posts
        Same problem huh
          Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
          • 26435
          • 1,193 Posts
          I think the logout works, but you are maybe seeing a cached version of the page?

          If you log in and it works, then you log out and it does not work, what happens if you go into the manager and clear the site cache then go back and refresh that page?

          -sD-
          Dr. Scotty Delicious, DFPA.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
            • 15987
            • 786 Posts
            If you clear the cache and return to the page it does show that you are logged out. So it looks like it is caching the page with the logout form displayed. I’m just not sure why it is doing that when I have the snippet call uncached.

            One thing I noticed was that on the one page where I have the page uncached everything works fine. If I try to logout on a non-cached page even if I return to the uncached page the logout button still displays. If I use the logout on the uncached page it will then log me out.

            I tried removing the chunk and just putting the snippet call into the template and am still not getting the correct output after logging out.


            After some more testing I have found that if I login on the uncached page, when I go to a cached page it displays the logout form. When I try to click logout, the page refreshes but there is no logout. If I return to the uncached page I can then logout. If I go to a cached page without logging in, the login form is displayed. If I try to login on the cached page, you get a refresh but are not logged in. If you go back to the uncached page you are able to login.

            So it looks like it is not caching the snippet call (like it shouldn’t), but the form is not evaluating correctly for logging in/out on a cached page.
              • 26435
              • 1,193 Posts
              Honestly, the form thing is just a simple if (getLoginUserID()) conditional statement.

              If it returns false, the login form is presented, otherwise, it gets returned the users id and presents the loginsuccess template. I am not sure what is going on with that that it is causing problems with MODx caching, but perhaps there is a better way to check if the user is logged in before returning either the form or the success message to the document?

              -sD-
              Dr. Scotty Delicious, DFPA.
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 15987
                • 786 Posts
                ok, I think I may have found the problem. I noticed that you are adding the javascript ieButtonFix, this javascript gets called regardless of the browser and seems to be causing some problems in Firefox. I have modified this file to detect IE and now everything seems to be working correctly. I have attached the updated file, I would be interested to see if this fixed the problem for others as well.

                Kyle
                  • 26435
                  • 1,193 Posts
                  Nicely done Kyle!
                  Excellent contribution.

                  -sD-
                  Dr. Scotty Delicious, DFPA.
                    Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                    All of the above... in no specific order.


                    I send pointless little messages
                    • 25046
                    • 194 Posts
                    I have been having caching headaches with weblogin 1.0 and now the same with webloginPE. I have tried almost everything I can think of, including updating the ieButtonFix code as per KyleJ’s suggestion, but with no success.

                    I can only conclude at this stage that what I am trying to do is something that was not intended for this function. Basically, I open a browser, login, and I get directed to a Project page just like I expected it to. When I return to the login page, I see a logout button (again, OK). When I click Logout, the Login form returns (OK). Now, when I login as a different user (to get to a different protected project page), it sends me to my unauthorized page. From there on, no user login works. Basically, I can only login as one user and when I try to logout and in again as a different user, no go. My snippet is not cached nor are my login and protected pages.

                    Any suggestions would be appreciated, even if it is to tell me to use something else.

                    Thanks!
                      • 25046
                      • 194 Posts
                      I’ll just add that closing and reopening the browser solves the logout problem everytime - however it’s a little awkward for me to ask users to do this. Is this a cookie problem?