Hello,
Could somebody explane me how i can read a session file and unserialize it
and read the array that is created.
**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 me how i can read a session file and unserialize it
and read the array that is created.
**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