unserialize session files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spam sucks

    unserialize session files

    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



  • Daniel Tryba

    #2
    Re: unserialize session files

    In nl.comp.program meren 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

    Comment

    Working...