Hello,
Could somebody explane to me how i can unserialize the content of a session
file, i allready reading the session files and the content now i only need
to unserialize the data in the files.
**script for reading session files**
function getUsersOnline( ) {
$count = 0;
$ses_dir=get_cf g_var('session. save_path');
$handle = opendir('/tmp');
if ($handle == false) return -1;
while (($file = readdir($handle )) != false) {
if (ereg("^sess", $file))
{
$count++;
$fh=fopen("$ses _dir/$file", "r");
while (!feof($fh))
{
$raw_data .= fgets($fh,4096) ;
}
$modified = stat("$ses_dir/$file");
echo date("j/m/Y - H:i:s", $modified[9]);
echo "</br>".$count."</br>";
echo "$raw_data<br>" ;
$raw_data="";
}
}
closedir($handl e);
}
getUsersOnline( );
**** end script **
Thanks in advance
G
Could somebody explane to me how i can unserialize the content of a session
file, i allready reading the session files and the content now i only need
to unserialize the data in the files.
**script for reading session files**
function getUsersOnline( ) {
$count = 0;
$ses_dir=get_cf g_var('session. save_path');
$handle = opendir('/tmp');
if ($handle == false) return -1;
while (($file = readdir($handle )) != false) {
if (ereg("^sess", $file))
{
$count++;
$fh=fopen("$ses _dir/$file", "r");
while (!feof($fh))
{
$raw_data .= fgets($fh,4096) ;
}
$modified = stat("$ses_dir/$file");
echo date("j/m/Y - H:i:s", $modified[9]);
echo "</br>".$count."</br>";
echo "$raw_data<br>" ;
$raw_data="";
}
}
closedir($handl e);
}
getUsersOnline( );
**** end script **
Thanks in advance
G
Comment