note 62034 added to function.session-decode

From: Date: Fri, 17 Feb 2006 21:14:39 +0000
Subject: note 62034 added to function.session-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-103938@lists.php.net to get a copy of this message
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 ---- Server IP: 216.194.113.175 Probable Submitter: 66.113.128.10 ---- Manual Page -- http://www.php.net/manual/en/function.session-decode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+62034 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62034&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62034&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62034&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62034&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62034&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62034&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62034&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+62034&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103938) next »