PHP gives session error on remote server, but not local test machine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PHP list,

I have a large set of PHP scripts of my own design that outputs any errors to text log files.

These scripts are deployed on a few different sites, at different virtual hosting services. On one, I keep seeing this error in my log files:

Error Handler message: session_start() [<a href='function.session-start'>function.session-start</a>]: The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' /home/domains/mydomainname.com/public_html/index.php 107

Before I show the content of index.php, I want to emphasize that no other virtual host produces this error. My home testing environment doesn't either. I have doubly ensured that the scripts are the same across all environments. So there must be something in the interaction of my scripts on that hosting service that is causing this error.

Here are the contents of index.php, trimmed of most comments for brevity. Line 107 is where the last session_start() call is.

My question is why would this code trip an error on one server, but not all?

Thank you for any advice.

--- code ---

include_once '+site/Settings.php';
include_once 'Global.php';
set_error_handler(array('ErrorHandler','handleError'), E_ALL);
// initialize the output tree. This is the structure that receives all the ouput and stores it in a tree form
// based on the HTML structure
HTML::initializeTree();
$userRequest = trim($_SERVER['REQUEST_URI'], "/");
if (Browser::supportsCookies())
{
	session_start();
}
else
{
	if (strlen($userRequest) != 0)
	{
		$sessionArray = Session::decodeSessionID($userRequest);
		if (is_array($sessionArray))
		{
			session_id($sessionArray[0]);
			$userRequest = $sessionArray[1];
		}
		else
		{
			$userRequest = $sessionArray;
		}
	}
	session_start();
}

--- code ends ---

--
Dave M G
Articlass - open source CMS
http://articlass.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux