Connecting Tech Pros Worldwide Forums | Help | Site Map

unserialize session files

Spam sucks
Guest
 
Posts: n/a
#1: Jul 17 '05
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_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




Daniel Tryba
Guest
 
Posts: n/a
#2: Jul 17 '05

re: unserialize session files


In nl.comp.programmeren Spam sucks <nomail> wrote:

FUP: comp.lang.php
[color=blue]
> 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.[/color]

Take a look at session_decode()

--

Daniel Tryba

Closed Thread