I have been trying everything to get sessions to work on my machine running windows xp with IIS. The problem that I get is when I try to switch pages, PHP doesn't seem to see the previous session.
The only way that I have been able to get this to work is by giving each session a name, then passing the name and session id in the URL. This seems to be a very combersome hack, and I haven't seen any examples that require this.
Below is the code I'm trying to run (from the Luke Welling book)
/***page1.php****/
<?php
session_start ();
$_SESSION['sess_var'] = "Hello world!";
echo 'The content of $SESSION[\'sess_var\'] is '
.$SESSION['sess_var'].'<Br />';
echo '<A href="page2.php">Next page</A>';
?>
/***page2.php****/
<?php
session_start ();
echo 'The content of $SESSION['sess_var'] is '
.$SESSION['sess_var'].'<Br />';
?>