2] unserialize the data column using this function
function DecodeSession($sess_string)
{
// save current session data
// and flush $_SESSION array
$old = $_SESSION;
$_SESSION = array();
// try to decode passed string
$ret = session_decode($sess_string);
if (!$ret) {
// if passed string is not session data,
// retrieve saved (old) session data
// and return false
$_SESSION = array();
$_SESSION = $old;
return false;
}
// save decoded session data to sess_array
// and flush $_SESSION array
$sess_array = $_SESSION;
$_SESSION = array();
// restore old session data
$_SESSION = $old;
// return decoded session data
return $sess_array;
}
3] print out the username which should be stored in the session data, it'll look
something like
echo $session['data']['Namespace']['user']['username'];
No comments:
Post a Comment