////////////// PAGE 1 //////////////////
<?php
session_start();
// Use of session_register() is deprecated
$barney = "A big purple dinosaur.";
session_register("barney");
// Use of $_SESSION is preferred, as of PHP 4.1.0
$_SESSION["zim"] = "An invader from another planet.";
// The old way was to use $HTTP_SESSION_VARS
$HTTP_SESSION_VARS["spongebob"] = "He's got square pants.";
?>
////////////// PAGE 2 //////////////////
<?php
session_start();
if (!session_is_registered(barney)) {
echo "<br> show barrney => ". $_SESSION["barrney "] ;
} else {
echo "<br> No value of barrey variable";
}
?>