* @copyright 2004 http://www.php-tools.net * @license LGPL **/ // load error handler include_once './_error.php'; include_once '../patSession.php'; // create the first session object $sess1 =& patSession::create( 'first' ); $sess1->set( 'fb', 'fine business' ); // create another one - with the same name (and the same storage) $sess2 =& patSession::create( 'first' ); if( $sess1 === $sess2 ) { echo '
Session 1 and 2 are references to a single instance.
'; } // create one more - use the same storage and name. $sess3 =& patSession::create( 'first', 'Native', array( 'expire' => 10 ) ); if( $sess1 === $sess3 ) { echo '
Session 1 and 3 are references to a single instance.
'; } // create a different instance $sess4 =& patSession::create( 'second' ); $sess4->set( 'fb', 'these are just a few letters.' ); if( $sess1 !== $sess4 ) { echo '
Session 1 and 4 are different objects.
'; } ?>