<?php
session_start();
$old_sessionid = session_id();
session_regenerate_id();
$new_sessionid = session_id();
echo "Old Session: $old_sessionid<br />";
echo "New Session: $new_sessionid<br />";
?>
if(session_status() == PHP_SESSION_ACTIVE)
{
session_regenerate_id();
}