I found session_regenerate_id will not work it together with session_destroy(), please see this one works
<?php
session_start();
$old='old is: '.session_id();
session_regenerate_id(true);
echo $old;
echo '<br>';
echo 'new is: '.session_id();
?>
this one failed, return 2 same session id numbers
<?php
session_start();
$old='old is: '.session_id();
session_regenerate_id(true);
session_destroy();
session_unset();
session_start();
echo $old;
echo '<br>';
echo 'new is: '.session_id();
?>
I use php 5.3.3, the second one is a recommended method to produce a new session, but why it does not work on my side.
thanks everyone,after tests, I found session_destroy must be invoked before session_regenerate_id(), or session_regenerate_id never works.
<?php
session_start();
$_SESSION['abc']=12323;
$old='old is: '.session_id();
session_unset();
session_destroy();
session_start();
session_regenerate_id(true);
echo $old;
echo '<br>';
echo 'new is: '.session_id();
?>