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
?>