We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10896
    • 76 Posts
    Hi

    I’m not sure where to post this question. Sorry.

    We have a MODx installation where the MODx manager has begun randomly "kicking" us out of the manager. It happens without fail when I attempt to move in the document tree. But most times you can work for a minute or so before it goes back to the login screen. At this point I have to type in my user/pass info about 3-5 times before getting back in.

    Does anyone have any thoughts on troubleshooting this?

    Thanks.
      • 24414
      • 45 Posts
      There’s a thread about random logouts that you may want to have a look at here:

      http://modxcms.com/forums/index.php/topic,15413
        • 10896
        • 76 Posts
        Hey thanks for pointing out that thread. I’ve looked at the issues there and not really found anything that’s helped.

        Some things we know

        • Our particular installation is on a web cluster - which means sessions aren’t so good. We’ve included our standard session replacement technique with a db session storing function.
        • We have five sites set up this way and only one is having the manager logouts
        • We’ve found that the manager will always log us out when we try to move a document in the document tree - all browsers
        • All other logouts can be sporadic depending on the browser - safari tends to be the most stable
        • When we are logged out we check the session value and the session key is there but the value is blank

        Any other thoughts on something we can try?
          • 22303 MODX Staff
          • 10,725 Posts
          If you want to share details of your "standard session replacement technique" and the "db session storing" function, along with some more details about the cluster configuration, I’ll be more than glad to make some suggestions or share any advice I can.
            • 30882
            • 3 Posts
            Hi OpenGeek -

            The site in question is hosted on a load-balancing web cluster - and so we cannot use standard PHP session handling. To get around the load-balancing nature of the cluster, we’re using a PHP script that redefines the PHP session functions [ ie session_set_save_hander() -- http://www.php.net/session_set_save_handler ], and allows us to store the session information in a MySQL database table.

            The system more or less follows the same methods as Ying Zhang’s PHP/DB sessions solution found here: http://www.phpbuilder.com/columns/ying20000602.php3

            Let me know if you have any further questions about that smiley
            twykr.

            Quote from: OpenGeek at May 16, 2008, 10:12 AM

            If you want to share details of your "standard session replacement technique" and the "db session storing" function, along with some more details about the cluster configuration, I’ll be more than glad to make some suggestions or share any advice I can.
              • 10896
              • 76 Posts
              Hey OpenGeek

              Here’s our team’s internal conversations over this issue. Hopefully it sheds some light on this for you. Please let us know if you come across something that may resolve this issue.

              (Feel free to remove the attachment once you’ve gotten a copy.)

              Thanks
                • 25663 MODX Staff
                • 12,272 Posts
                Thanks for the research gl330k. We’ve seen some similar issues with clusters and random logouts from the managers. It may be a Proxy configuration issue (we’ve seen it on EC2 instances running HA Proxy ourselves). If a DB session solution surfaces for 096x that works and tests rock solidly, we’ll gladly include it in the main release. It’s a tricky problem indeed with the existing code branch.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 22303 MODX Staff
                  • 10,725 Posts
                  I may have discovered the problem here. Can you modify the startCMSSession() function in your manager/includes/config.inc.php file to look something like this:
                  if(!function_exists('startCMSSession')) {
                      function startCMSSession(){
                          global $site_sessionname;
                          session_set_cookie_params(604800);
                          session_name($site_sessionname);    
                          session_start();
                      }
                  }
                  

                  The 604800 should make the cookie valid for 7 days. The explicit call to setcookie() in the older version seems to be causing some of the problems. Let’s start there, and if that doesn’t solve it, I have some other ideas regarding questionable uses of $_SERVER variables throughout the manager.
                    • 10896
                    • 76 Posts
                    Thanks for the tip OpenGeek. It doesn’t appear to be working. The other thing we may not have mentioned is that we have 4 other MODx sites running on this server setup. All these sites are setup the same way to handle sessions... and none of them are having issues like this. It’s just this one site. sad
                      • 22303 MODX Staff
                      • 10,725 Posts
                      Quote from: gl330k at May 21, 2008, 02:35 PM

                      Thanks for the tip OpenGeek. It doesn’t appear to be working. The other thing we may not have mentioned is that we have 4 other MODx sites running on this server setup. All these sites are setup the same way to handle sessions... and none of them are having issues like this. It’s just this one site. sad
                      Sounds like something specific to that install then; perhaps a plugin that’s causing problems?