When using this function to manage sessions, it is MUCH
better to have register_globals turned off. Then one can
examine the session content given its id.
<?php
$fname = session_save_path() . "/sess_" . $the_sid;
if (session_decode(file_get_contents($fname)))
{
$vars = $_SESSION;
$_SESSION = array();
}
?>
Depending on PHP version, you may need to have a dummy
session started for the code above to work. I reset the
$_SESSION immediately in order to avoid writing the
dummy session: that's needed while testing the code!