I'm having some puzzling problems with global session variables. Here's just an example of the code i'm testing:
Let's say I have a.php which is as follows:
Code: Select all
<?php
session_start();
if ( !isset($_SESSION['username']) ) {
$_SESSION['username'] = 'jason';
}
echo '$_SESSION[username] equals '.$_SESSION['username'];
echo '<br><br><a href="b.php">Go to page 2</a>';
?>Code: Select all
<?php
session_start();
echo '$_SESSION[username] equals '.$_SESSION['username'];
echo '<br><br><a href="c.php">Go to page 3</a>';
?>BTW, my host runs the following:
PHP 4.3.1
Server Operating System: Windows 2000 Server
Server Management: Microsoft IIS 5.0
Thanks, Tom