We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8261
    • 19 Posts
    I believe this error is taking up a lot of my server resources - every 2-3 seconds the server log shows this error:

    [error] PHP Warning: session_start(): The session id contains invalid characters, valid characters are only a-z, A-Z and 0-9 in /public_html/manager/includes/config.inc.php on line 59

    I’m running a UNIX server (CENTOS Enterprise 4.6 i686 w/ cPanel) with PHP 4.4.2 with ’--enable-trans-sid’ and ModX v. 0.9.6. I have no idea what could be causing this error - it happens even when I’m not logged into the manager.

    Any ideas?
      • 8261
      • 19 Posts
      I’m still trying to get rid of this error...

      In config.inc.php there’s a line where the global $site_sessionname is set:

      $site_sessionname = ’SN478e63b71a8cf’;

      which contains only a-z, A-Z and 0-9. Does anyone know the purpose of this variable, and if it ever changes?

      Then later the function startCMSSession() calls the following:

      global $site_sessionname;
      session_name($site_sessionname);
      session_start();

      The session_start() is creating an error every 2-3 seconds - even when I’m not logged into the manager.

      I thought maybe some bot was coming by and attempting to access the manager, so I disallowed the /manager/ folder in robots.txt, but this didn’t work.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        That is just a randomly created string, created on installation, to use for a session name instead of the default PHPSesson. The session is started every time a page is requested, whether the visitor is logged in or not.

          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
          • 8261
          • 19 Posts
          That’s strange... if this session is started with the same session id every time someone requests a page, why would errors show in the log only sometimes? The last "The session id contains invalid characters" server log error was yesterday at 8am - and for several hours before that every 2-3 seconds. If this ID doesn’t change, what’s causing the start_session() function to fail sometimes?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Unless some bot or another is trying to ping his site with random session IDs.
              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
              • 8261
              • 19 Posts
              Currently upgrading is not an option >:(

              I did find this on the php site

              http://us.php.net/manual/en/function.session-start.php#72444

              It talks about bots trying to steal your session and using bad characters or strings longer than 32 to do it.

              I added the code in the config, we will see if it works.