We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23491 ☆ A M B ☆
    • 1,056 Posts
    All--

    I have been experiencing random Manager logouts for some time now. It is quite puzzling, not to mention frustrating. This has been the case for me since 0.9.5+ on a wide array of platforms, PHP/MySQL versions, servers, operating systems, etc.

    The manager logouts are so frequent at times that it really is starting to impact productivity and efficiency, especially when re-work is required as a result of lost changes from the unintentional logout.

    I made an observation immediately before I was force-logged out this evening... I quickly logged back in and then right before I was logged out again I noticed the same thing that caught my eye on the previous logout:

    In the top frame of the manager resides a menu, usually looks something like this:


    Right beneath this menu is where you’ll find the "Working..." status indicator, etc.


    Now, I noticed right as I was being logged out that the menu had changed! It now looked like this:


    Hmmm....very odd. I have been able to replicate this behavior and each time prior to being force logged out, I notice that my menu changes as indicated above.

    Looking at the generated HTML is more revealing:

    <div id="supplementalNav">
             <img src="media/style/MODxLight/images/icons/user_go.png" height="16" width="16">
            <a onclick="this.blur();" href="index.php?a=28" target="main">username</a> | <span style="display: none;" id="newMail"><a href="index.php?a=10" title="You got mail" target="main"> <img src="media/style/MODxLight/images/icons/email.png" height="16" width="16"></a></span>
                <a onclick="this.blur();" href="index.php?a=10" target="main">Messages <span id="msgCounter"><title>MODx CMF Manager Login</title>(
    
    
    
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="robots" content="noindex /  nofollow">
    
    <style type="text/css"></style>
    
    /* Neutralize styles)</span></a>
             
                             | <a href="index.php?a=9" target="main">Help</a>
                             | <a href="index.php?a=8" target="_top">Logout</a>
                 | <span title="Website name - MODx 0.9.6 (rev 2767)">0.9.6</span> 
        </div>
    


    Specifically, this is the HTML that appears out of place:


    <span id="msgCounter"><title>MODx CMF Manager Login</title>(



    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="robots" content="noindex / nofollow">

    <style type="text/css"></style>

    /* Neutralize styles)</span>

    Provided you don’t have any messages, normally it would just read:

    <span id="msgCounter">(0 / 0)</span>

    To be fair, the fact that the AJAX request behind updating the msgCounter container fails doesn’t necessarily indicate that it is the Source of the problem, however it is an initial indicator of things to come.

    It appears the request fails as a result of no longer being authenticated. I say this because:

    1. <title>MODx CMF Manager Login</title> is contained within the failed msgCounter update
    2. Once this glitch is witnessed, any accompanying server-side action performed within the manager is followed by a forced Manager logout.

    It would seem that the logout should actually happen earlier, but since authentication cannot be confirmed within the AJAX request, it might not force logout/redirect as intended, resulting in the return of part of the Manager Login page as the AJAX Response?

    I’m not sure this puts me any closer to understanding the Source of the mysterious manager logout problem, but at least there is a form of indicator prior to actually being force logged out. I’d be interested if the request(s) behind the msgCounter update/etc are in anyway related to the problem itself.
      Mike Reid - www.pixelchutes.com
      MODx Ambassador / Contributor
      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
      ________________________________
      Where every pixel matters.
      • 5727
      • 160 Posts
      I once had a similar problem with a home made CMS I built for a client. I had been reusing the same piece of code for authenticating users on many projects before, but on that specific host (shared host), I was getting logged out sporadically. I tried many, many things and still I can’t say for sure what’s the problem, but it seems that changing the session settings in PHP helped my cause. My advice would be, if possible, to create a tmp folder at the root of your account (give it a random name if you can’t go higher than your web root) and configure PHP sessions to use that folder. This way other scripts on your shared host can’t get rid of your sessions files early if they execute the garbage collector faster than you. If you need more help on doing that, PM me or look at the PHP doc.

      Just a wild guess here... take it as my 2 cents. wink
        Olivier Deland
        Montreal, Canada - Web Developer
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        Interesting suggestion, thank you. Honestly, I am experiencing this on both shared web hosts and dedicated server/VPS environments. However, I wonder if simply changing the session location could solve the issue for me, possibly per MODx instance. At this point, I’m willing to try anything to keep a constant manager session. What’s weird is the degree of fluctuation. One minute I can stay logged in for hours at a time, and the next I am getting force-logged out literally less than every 5 minutes... sad
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 5727
          • 160 Posts
          It’s indeed a puzzling situation and can be verrrry frustrating at time.

          The fact that it happens sporadically could be caused by another script using the same session directory. Read this note on that matter:

          Note: If different scripts have different values of session.gc_maxlifetime but share the same place for storing the session data then the script with the minimum value will be cleaning the data. In this case, use this directive together with session.save_path.

            Olivier Deland
            Montreal, Canada - Web Developer
            • 24414
            • 45 Posts
            I’ve been experiencing the manager logouts as well, they appeared for the first time today and have been plaguing me for the past few hours. I haven’t noticed the ’Neutralize styles’ text on my setup though.

            So far the logout has only happened on saving documents, they are successfully saved though.

            Server:
            MODx 0.9.6
            Apache 1.3.33
            PHP 5.2.0
            MySQL 5.0.24a
            Mac OS X 10.4.9

            Client:
            Firefox 2.0.0.4 (OS X / 10.4.9)
              • 24414
              • 45 Posts
              It seems I was wrong about the manager logout issues only being on document saves. In Resources>Manage Resources I am unable to view TVs/Chunks/Snippets/Plugins although I can view templates.

              I switched browsers to WebKit and these glitches [appear to] stop.

              Edit
              Had a look in Opera could not reproduce the issue. Switched back to Firefox and could no longer reproduce lack of access to TVs/Chunks/Snippets/Plugins, however am still being logged out doing actions like save / duplicate. Very strange!

              Edit 2
              Have disabled the EditArea plugin and Firefox seems to save without the logouts. Enabling again seems to restart the issue.

              When viewing the Firefox error console it throws 2 errors on just before it logs out:

              Error: document.getElementById is not a function
              Source File: xttp://rx9.dev/assets/plugins/edit_area/core/edit_area/edit_area_compressor.php
              Line: 5

              Error: document.getElementById is not a function
              Source File: xttp://rx9.dev/manager/media/script/mootools/mootools.js
              Line: 2

              Note
              Whilst disabling EditArea seems to have stopped random logouts (so far) the logouts also originally affected the viewing of TVs which aren’t replaced by the plugin.
                • 23491 ☆ A M B ☆
                • 1,056 Posts
                Ram,

                Very interesting indeed. I’ve wondered a few times whether the 3rd party plugins could be behind it, especially since I do use the EditArea plugin on every MODx instance, not to mention that not many people are experiencing the same issue.

                I have also noticed EditArea’s JS error...I wonder if it in anyway is conflicting with the AJAX JavaScript behind keeping the session alive?

                The thing to really keep in mind, however, is that in my experience I often times am randomly logged out when not even dealing with Editing, meaning no EditArea involved.

                For example, there are times when I try to expand the document tree directly from the default login page (Manager Home) and am also logged out with the accompanying EditArea JS bug.

                Hmmmm...
                  Mike Reid - www.pixelchutes.com
                  MODx Ambassador / Contributor
                  [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                  ________________________________
                  Where every pixel matters.
                  • 24414
                  • 45 Posts
                  Yup I personally thought it would be a bit strange if it was EditArea as on my setup as the logouts were affecting the viewing of TVs and also happened (randomly) on duplicating documents and viewing Reports>System Info. The manager logouts only actually started yesterday, and EditArea has been running on the system (and others) with no problems for around a week.

                  Very strange.

                  I’ve had it running for around 30 mins without logouts after disabling EditArea, but I stopped work soon afterwards so testing wasn’t incredibly thorough. Will see if I have any more logouts this afternoon and then try re-enabling it later.

                  Edit
                  Have my first logout with the EditArea plugin disabled. This time I was trying to access Modbak in the Modules>Manage Modules section.
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Sounds to me like you guys just have a very proactive garbage collection process that kills your sessions frequently. Does it happen about every 20 mins or so, or is it easily more frequent based on where you navigate to?
                      • 23491 ☆ A M B ☆
                      • 1,056 Posts
                      Quote from: OpenGeek at Jun 04, 2007, 10:22 AM

                      Sounds to me like you guys just have a very proactive garbage collection process that kills your sessions frequently. Does it happen about every 20 mins or so, or is it easily more frequent based on where you navigate to?

                      In my experience, it is actually quite random. There are times when I can go for a few hours working, then suddenly a series of logouts. In some cases, the logouts continue to occur literally every few seconds/minutes, and it does not seem to be tied to anything specifically (e.g. Saving, Editing a document, etc)
                        Mike Reid - www.pixelchutes.com
                        MODx Ambassador / Contributor
                        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                        ________________________________
                        Where every pixel matters.