note 62034 rejected from function.session-decode by nlopess
| From: | nlopess@php.net | Date: | Fri, 17 Feb 2006 21:44:01 +0000 |
| Subject: | note 62034 rejected from function.session-decode by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-103940@lists.php.net to get a copy of this message | ||
Note Submitter: ajcoon at gmail dot com
----
I've been strugging to get a session-encoded object, implemented as a PHP5 class, to decode
correctly. So far, I have learned that:
1. Session-encoded data is different than serialized data because a session implies variables (named
values), while serialized data is *just* values (no names). The addition of 'varname|'
prefaces a value in session-encoded data while not in serialized data values.
2. PHP5 classes obfuscate protected and private members in session-encoded data by wrapping the
quoted variable names with null characters.
So when I pass a session-encoded object, implemented as a PHP5 class, into session_decode(),
$varname is never set. I've tried using an fgetc algorithm that strips the nulls (i.e.
<?php if( $char != chr(0) ) $mystr .= $chr; ?> ) but passing that doesn't make any
noticable difference- $varname is *still* not set.
Does anyone have any suggestions as to how I can go about this? Also, is there any way to get more
verbose output from session_decode so that I know what problem it encounters?
-aj