PDA

View Full Version : how to use session_regenerate_id effectively ??


PHPycho
09-14-2007, 05:38 AM
hello forums !!
I would like to know how to use session_regenerate_id() effectively..
i tried it as:
session_start();
if(!empty($_SESSION)){
session_regenerate_id(true);
}
i dont whether it is correct or else .
Hope to have same comments on it.
Thanks in advance

Inigoesdr
09-14-2007, 05:45 AM
This is... from the example on the manual page
<?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 />";

print_r($_SESSION);
?>
What was your question?