We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20400
    • 37 Posts
    I was continually and unexpectedly being logged off the Modx manager on a new install of Evolution on the Network Solution hosting service. It took me best part of a day to find this out problem, so I thought I would post the solution here. Maybe save someone some time.

    The problem is hinted at on the ht.access file in the manager directory which points to:

    http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions

    in the Sessions section it has a solution
    If you are deployed in an environment that has problems with aggressive garbage collection, as evidenced by unexpected and frequent logouts from the manager,
    Unfortunately, the solution offered makes the Network Solutions server go ’ga-ga’ (a technical term for a 500 error).

    The solution is first to create directory under /htdocs for the session files, I named mine php_tmp. Then create a php.ini file in the /cgi-bin directory. (Turned off the GLOBALS at the same time.)

    register_globals = Off
    session.save_path = /full/path/to/htdocs/php_tmp/
    


    BTW - putting a php.ini into the /cgi-bin doesn’t seem to be in the Network Solutions documents. However, I have used it in other places so I tried it and it worked.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Keep in mind that when you specify your own session location that there will be no garbage collection at all, so your session files will really add up in time. When I was forced to do this, I created a module to let the site admin clear out old session files from time to time. You could also make it a plugin that mimics the PHP auto garbage collection functions.

      I have also successfully cured this behavior by changing the interval of the image request in the manager/media/js/session.js file to a shorter interval.
      window.setInterval("keepMeAlive(’keepAliveIMG’)", 1000 * 60);
      http://www.w3schools.com/htmldom/met_win_setInterval.asp
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 20400
        • 37 Posts
        I expected that to be a problem - but it hasn’t happened. The files are cleared at the end of the day. It looks like PHP is cleaning up expired session files.

        My sites aren’t overly busy, but for a busy site I would write a cron job to clear the session files every few hours. There is a useful script at http://tips-scripts.com/session_delete

        MR