Nice and simple solution:

function decode_session_data($encoded) {
  $backup = $_SESSION;
  $_SESSION = array();
  session_decode($encoded);
  $ret = $_SESSION;
  $_SESSION = $backup;
  return $ret;
}

// (got the string from the first page of this post)
print_r(decode_session_data('Config|a:3:{s:4:"rand";i:1482441247;s:
4:"time";i:1179247983;s:9:"userAgent";s:
32:"cc98eaffc23c634e0efd75ab9e36e810";}'));

// Outputs this:
Array
(
    [Config] => Array
        (
            [rand] => 1482441247
            [time] => 1179247983
            [userAgent] => cc98eaffc23c634e0efd75ab9e36e810
        )

)



--~--~---------~--~----~------------~-------~--~----~
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