session_regenerate_id

Update the current session id with a newly generated one (PHP 4 >= 4.3.2)
bool session_regenerate_id ( )

session_regenerate_id() will replace the current session id with a new one, and keep the current session information.

Returns TRUE on success or FALSE on failure.

Example 862. A session_regenerate_id() example

<?php
session_start
();

print
session_id();

session_regenerate_id();

// This is now different
print session_id();

print_r($_SESSION);
?>
Note:

As of PHP 4.3.3, if session cookies are enabled, use of session_regenerate_id() will also submit a new session cookie with the new session id.

See also session_id(), session_start(), and session_name().

This HTML Help has been published using the chm2web software.