On 7/19/07, Ryan Graciano <[EMAIL PROTECTED]> wrote:

I'm having an issue getting session_decode to work from my session handler in 
PHP 5.2.3.  Here's a short code snippet that demonstrates what I'm trying to do 
(from my read handler) -

public function read($id) {
....
var_dump($data);  // prints out the serialized session correctly
$retval = session_decode($data);
var_dump($_SESSION);  // prints out "array(0) {}"
echo $retval;  // prints false
return $data;
}

In my calling function, $_SESSION is updated with everything that was held in 
$data, which means that $data was not corrupt - it worked when I returned it, 
but it did not work when I used session_decode.  This is a problem because I 
want to change my read($id) function so that it decodes $data, adds something 
extra to the $_SESSION, then re-encodes $data and returns it.

Thanks,
- Ryan

How did you get $data?

If it's just serialized data, you can simply call unserialize instead
of session_decode.

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to