This is how I got it working.

//To get the correct session ID use:

$sid = $_COOKIE['CAKEPHP'];

//To get and parse the data

$sql = "SELECT data FROM $app_session_table s WHERE s.id = '$sid' ";
    $res = dbi_query($sql);
    $variables = array(  );

    $record = mysql_fetch_array($res);
    $myData = $record[0];
    $uid= NULL;

    $a = preg_split( "/(\w+)\|/", $myData, -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] );
        }

    //All session arrays are now contained in our variables array.
   //Get the array you want with the proper key.
    $myData =   $variables['User'];

   //All the User session data is now in the myData array.  Use the
   //session key to get the value you want.
   $uid = $myData['username'];
--~--~---------~--~----~------------~-------~--~----~
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