(PHP 4 >= 4.3.2, PHP 5)
session_regenerate_id() will replace the current session id with a new one, and keep the current session information.
Whether to delete the old associated session file or not. Defaults to FALSE.
Returns TRUE on success or FALSE on failure.
Example 1. A session_regenerate_id() example
<?phpsession_start();$old_sessionid = session_id();session_regenerate_id();$new_sessionid = session_id();echo "Old Session: $old_sessionid<br />";echo "New Session: $new_sessionid<br />";print_r($_SESSION);?>