* @copyright 2004 http://www.php-tools.net
* @license LGPL
**/
// load error handler
include_once './_error.php';
// include factory/loader
include_once '../patSession.php';
// most easy way to create a session object
$sess =& patSession::singleton( 'ham' );
if( isset( $_REQUEST['restart'] ) && $_REQUEST['restart'] == 'force' ) {
$sess->restart();
}
// see wheter the started session is new
if( $sess->isNew() ) {
echo 'Hurray! A new session was born! :-)
';
}
else {
echo 'Continue session...
';
}
if( !isset( $sess['counter'] ) ) {
$sess['counter'] = 0;
$sess['foo'] = 'bar';
$sess['pat'] = 'dog';
}
$sess['counter'] = $sess['counter'] + 1;
echo 'My personal Counter: ' . $sess['counter'] . '
';
echo 'Debbuging output
';
echo "
\n"; echo $sess; echo "\n"; // get query string echo '