about another answer. The description of session_decode is "session_decode (), decodes the session data in the data by setting the variables stored in the session." It doesn't look like it does what you need ... and also it will always return bool after parsing the string.
on the other hand, if the line you provided as an example had an error, a space after "12345" (and it looks like an error, because before it you see that the next value should be a line with length 5), you can use this function:
function unserialize_session_data( $serialized_string ) { $variables = array(); $a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); for( $i = 0; $i<count($a); $i = $i+2 ) { if(isset($a[$i+1])) { $variables[$a[$i]] = unserialize( $a[$i+1] ); } } return( $variables ); }
mishu
source share