Connecting Tech Pros Worldwide Help | Site Map

php unserialize session file

Spam sucks
Guest
 
Posts: n/a
#1: Jul 17 '05
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_cfg_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($handle);
}
getUsersOnline();


**** end script **

Thanks in advance


G



Closed Thread