<?php
//Sample file - Demonstrates the use of SessionCookie
require ("session.php");
$s = new sessioncookie();
//Open connection to db
$s->connect2db();
//Start session
$s->start();
//Delete old sessions
$s->gc(1440);
//Initialize the vars
//Register the variables
$name = "Christoph";
$mail = "php@chkassen.de";
$s->register("name");
$s->register("mail");
echo "After session_register() : \n<br><ul>" ;
echo "<li> \$name = ".$name."\n<br>";
echo "<li> \$mail = ".$mail."\n<br></ul>";
//Testing the isregistered function
if($s->isregistered("name") == 1) {
print "Name is registered\n<br>";
}
//Saving session data to database
$s->save();
?>
|