I am not able to view the session pages on my server but its working fine on my local server.My local server has PHP Version 4.3.0 and my server has PHP Version 4.2.2 .
this is the simple code to set session page1.php
Code: Select all
<?php
session_start();
header("Cache-control: private");
if ( !isset($_SESSION['username']) ) {
$_SESSION['username'] = 'jason';
}
echo '$_SESSION[username] equals '.$_SESSION['username'];
echo '<br><br><a href="session2.php">Go to page 2</a>';
?>Code: Select all
<?php
session_start();
header("Cache-control: private");
echo '$_SESSION[username] equals '.$_SESSION['username'];
echo '<br><br><a href="page3.php">Go to page 3</a>';
?>But when i upload it on my server it does not shows the session value.
any answer ?