We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24422
    • 15 Posts
    I’m using the WebLogin snippet with the pre-packaged WebLoginSideBar chunk and logout is not functioning properly in Firefox. When I click the logout link the URL gets re-written to http://mydomain.com/index.php?id=63&webloginmode=lo The problem is that the page never reloads. I just get a blank screen. The wierd thing is that everything works fine in IE on the PC and in Firefox on the Mac. It’s just Firefox on my PC that is not functioning.

    Any ideas? How can I fix this?

    I get the same problem when pages are cashed or uncashed and with friendly aliases turned on and off.

    I’m a newbee and in a bit of a rush, so any help will be greatly appreciated! smiley

    Thanks!
      • 10449
      • 956 Posts
      Sounds like a Firefox issue. What version do you use on PC? What extensions are activated? e.g. check if you have disabled redirects in the web-developer toolbar.
      It works as expected here, with the latest FF on WinXP...
        • 24422
        • 15 Posts
        I’m running FF 3.0.4 on Vista. No Extensions installed. I have a notification activated that alerts me when redirects happen, but I don’t have anything set to prevent redirects (as far as I know). Any other thoughts? This is mysterious.
          • 24422
          • 15 Posts
          Here’s a thought (and I confess to knowing practically nothing about php) is there a way to rewrite the code so that it doesn’t append the "webloginmode=lo" to the URL and yet still recognizes whether the user is logged in or out? If so, then I think that would solve the problem. Seems like there should be a way to pass the variable without appending it to the URL.

          Here’s one snippet of related code from weblogin.inc.php

          // display logout
          $tpl = $tpls[1];
          $url = preserveUrl($modx->documentObject[’id’]);
          $url = $url.((strpos($url,"?")===false) ? "?":"&")."webloginmode=lo";
          $tpl = str_replace("[+action+]",$url,$tpl);
          $tpl = str_replace("[+logouttext+]",$logoutText,$tpl);
          $output .= $tpl;

          And here’s another from weblogin.common.inc.php

          function preserveUrl($docid = ’’, $alias = ’’, $array_values = array(), $suffix = false) {
          global $modx;
          $array_get = $_GET;
          $urlstring = array();

          unset($array_get["id"]);
          unset($array_get["q"]);
          unset($array_get["webloginmode"]);

          $array_url = array_merge($array_get, $array_values);
          foreach ($array_url as $name => $value) {
          if (!is_null($value)) {
          $urlstring[] = urlencode($name) . ’=’ . urlencode($value);
          }
          }

          $url = join(’&’,$urlstring);
          if ($suffix) {
          if (empty($url)) {
          $url = "?";
          } else {
          $url .= "&";
          }
          }
          return $modx->makeUrl($docid, $alias, $url);
          }

          There’s also a bit about it in weblogin.processor.inc.php at line 93 (which seems to be related to password generation which I am not using and have not tested)

          But I don’t understand how they all fit together or why webloginmode=lo needs to be appended to the URL.

          Thoughts?
            • 24422
            • 15 Posts
            Ok, another interesting scenario. I’ve just tested the login using Lunascape rendering with Trident, Gecko and WebKit and they all work fine also. Seems like the problem is that for some reason on my version of FF when I click "logout" it rewrites the URL as index.php?id=2&webloginmode=lo but then never refreshes/discards the webloginmode=lo portion. In all other browser tests, the URL goes back to just index.php?id=2 which works fine.

            Seems like this might by chance just be a quirk in my paricular FF instance, but I’m concerned that the problem may manifest for other users. Any ideas on a work around? Like a forced rewrite of the url to lop off the webloginmode=lo after the logout processes...I mean other than how it already does/doesn’t do it?

            Thx
            C
              • 3749
              • 24,544 Posts
              The current version of FF I have on Vista is 3.0.10 so you might try again after an update.

              The link you posted above seems to work for me in FF w/ Vista Ultimate (I don’t get a blank page).
                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
                • 24422
                • 15 Posts
                Just updated. Same problem. Here’s the page. Can you tell me if it works for you? You can Sign Up for an account easily.
                http://salsamania.johnandlizproductions.com/blog.html
                  • 10449
                  • 956 Posts
                  works fine with 3.0.10 / XP
                    • 3749
                    • 24,544 Posts
                    The logout worked fine for me in FF3 Vista Ultimate, although I did see a white screen flash for about a second before the page reappeared.

                    BTW, you could use a link to the home page in the menu. wink
                      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
                      • 24422
                      • 15 Posts
                      I had some others test the page. Apparently FF on Windows doesn’t like the following

                      $modx->sendRedirect($url,0,’REDIRECT_REFRESH’);
                      Found on line 180 in weblogin.processor.inc.pho

                      But replacing this line simply with

                      $modx->sendRedirect($url);

                      Solves the problem.