I am having trouble getting sessions to work. I am using FreeBSD 6.0, Apache 2.0 and PHP 5.1.2. The following code worked in a previous installation without any modifications, but now it doesn't:
<?
$_SESSION['test'] = "Hello world!";
function hello()
{
echo $_SESSION['test'];
}
hello();
?>
It seems like $_SESSION['test'] is not accessible from the function hello().
phpinfo() on my server gives the following output:
From my server
If I execute the code on the following server, it works fine:
From other server
Does anyone know what to do, to make it work??