Hello,
HEELP
I have a problem with a session variable that cannot be read in other scripts. This problem seems to be very common but I still did not find any solution of my problem.
I am running PHP4.3.11, using Apache 2 and OS windows 2000.
My PHP files have been installed on another system as well running PHP5, apache 2 and LINUX and I have no problems there.
In c:\winnt\tmp I notice that a file is created for each change of the session variable count. This file contains correct value but apparently I cannot read from c:\winnt\tmp.
Since my code seems to function in other environment my problem most likely is a configuration problem.
My php.ini
register_globals = ON
session.save_handler = files
session.save_path = "C:\WINNT\Temp"
session.use_cookies = 1
session.use_only_cookies = 0
session.name = PHPSESSID
session.auto_start = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_secure =
Below the start script php_sessionTest.php is shown. php_sessionT2.php does not print the count value = 1.
However in the php_sessionT3.php A reload is done
<a href="<?=$_SERVER["PHP_SELF"]?>">reload</a>
and now is the global variable count incremented but only
as long I cóntinue with reload.
My files:
start from file php_sessionTest.php
<?php session_start(); ?>
<html>
<head><title>Session</title></head>
<body>
<?php
if (!isset($SESSION['count'])) {
$SESSION['count'] = 1;
} else {
$SESSION['count']++;
}
?>
<?php
echo('count =');
echo $SESSION['count'];
echo ("<p>");
?>
<!-- <p><a href="<?=$_SERVER["PHP_SELF"]?>">Ladda om</a></p> -->
<p><a href="http://127.0.0.1/ccdtestsida/test/php_sessionT2.php">go to php_sessionT2</a></p>
</body>
</html>