* @copyright 2004 http://www.php-tools.net * @license LGPL **/ // load error handler include_once './_error.php'; // include factory/loader include_once '../patSession.php'; $options = array( 'security' => 'fix_browser,fix_ip', 'empty-referer' => 'allow' ); $sess =& patSession::singleton( 'ham', 'Native', $options ); // get old session id $oldId = $sess->getId(); if( isset( $_GET['fork'] ) && $_GET['fork'] == 'yes' ) { // fork session $sess->fork(); } ?>
Store custom value...
Name:
Value:
 

Forking session for security reason

Create a new session and copy all values from the old session to the new one. Forking will clone the session - with a new session-id.

This features allows to separate from authorized sessions and anonymous sessions/users. For example during the loggin process.

Forking a session results in a new session id.
Session ids:
old: ' . $oldId . "
\n"; echo 'new: ' . $sess->getId() . "
\n"; $queryString = $sess->SID; echo '
Continue this session
'; echo '
Fork this session
'; if( isset( $_POST['submit'] ) ) { $sess->set( $_POST['name'], $_POST['value'] ); } echo "
Print session values for debug
\n"; echo "
";
    echo $sess;
	echo "
"; ?>