This function replaces the current session id with a newly generated one .

Syntax: session_regenerate_id()

Description:

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

Example:
Code:

session_start();

$old_sessionid = session_id();

session_regenerate_id();

$new_sessionid   session_id();

echo  "Old Session: $old_sessionid
"; echo "New Session: $new_sessionid
";

Explanation:

eXTReMe Tracker