win32 session problem
Posted: Mon May 12, 2003 3:39 am
Hello,
I'm trying to get a grip on php sessions. I have searched and have seen similar problems on this forum, but none with a suitable solution so here goes:
The following code was taken from the php docs and runs as expected on my *nix box (Apache 1.3.24 + php v4.1.2). Whenever I refresh the page, count is incremented.
When I try running the script on my local windows machine (Apache 2.0.45 + php v4.3.1) count is not incremented. On further inspection I found that a new session file with a new sid is being created in my winnt-temp directory on every refresh. My browser flags a cookie when running the script on *nix but not on windows, so I presume this is the problem. My php.ini setup on windows seems to be the same as the *nix setup, but I can't think of anything else that could cause this problem.
Settings of relevance:
session support is enabled
register globals is off
session.cookie_path = /
session.save_handler = files
session.use_cookies = On
session.use_trans_sid = Off
session.save_path = e:\winnt\temp
Thanks in advance,
Eoin.
I'm trying to get a grip on php sessions. I have searched and have seen similar problems on this forum, but none with a suitable solution so here goes:
The following code was taken from the php docs and runs as expected on my *nix box (Apache 1.3.24 + php v4.1.2). Whenever I refresh the page, count is incremented.
Code: Select all
<?php
session_start();
if(!isset($_SESSION['count']))
{
echo "Setting count<br>";
$_SESSION['count'] = 0;
} else
{
echo "Incrementing count<br>";
$_SESSION['count']++;
}
echo "Count: " . $_SESSION['count'];
?>Settings of relevance:
session support is enabled
register globals is off
session.cookie_path = /
session.save_handler = files
session.use_cookies = On
session.use_trans_sid = Off
session.save_path = e:\winnt\temp
Thanks in advance,
Eoin.
Code: Select all
Code: Select all
<?php
?>