valid sessions on my system look like this

Config|a:3:{s:4:"rand";i:1735136669;s:4:"time";i:1175943092;s:
9:"userAgent";s:32:"cc98eaffc23c634e0efd75ab9e36e810";}
User|a:5:{s:2:"id";s:1:"6";s:9:"author_id";s:1:"5";s:
12:"publisher_id";s:1:"0";s:9:"logged_in";i:1;s:4:"type";s:1:"A";}

(two arrays)

i'm asking myself if the "|", lets my reading fail...

this works for my, instead of unserialize:

$temp = mysql_query('SELECT * FROM sessions');
while ($row = mysql_fetch_array($temp)){
            $variables = array(  );
            $a = preg_split( "/(\w+)\|/", $row['data'], -1,
PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
            for( $i = 0; $i < count( $a ); $i = $i+2 ) {
                $variables[$a[$i]] = unserialize( $a[$i+1] );
                }
        }

should be combined with a session model in order to
avoid explicit sql quering.

i can live with that :-)

still searching for a method to collect session garbage.
once i got this done, multiple logins are prevented and
my auth system will be finished...

cheers, jyrgen


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to