<!--------- Page 1 --------->
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
echo 'This is page 1';
// Set session variables
$_SESSION["user_name"] = "ron";
$_SESSION["country"] = "usa";
echo '<br /><a href="page2.php">page 2</a>';
?>
</body>
</html>
<?php
/*
run:
This is page 1
page 2
*/
?><!--------- Page 2 --------->
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
echo 'This is page 2 <br />';
echo $_SESSION["user_name"] . "<br />";
echo $_SESSION["country"] . "<br />";
?>
</body>
</html>
<?php
/*
run:
This is page 2
ron
usa
*/
?>