I am trying to manually decode a session using session_decode, and the when I use PHP 4.1.1, the session is decoded (and registered in global namespace) properly. When I use 4.anything.later the session is not decoded properly.
I've tried checking the return value from session_decode, but that always returns false (with all the versions I've tested).
I have register_globals turned on, and magic_quotes_gpc turned off. Other than that, all options are default.
Here is an example of how I am using session_decode in my program. Can you see anything that might be amiss?
<?
function my_decode($sessionData) {
// Make the global so the session_decode function will put
// the session data in the proper scope.
global $srvsess;
/*
Decode the session here
session_decode seems to always returns false, even if
it succeeds, so we don't check its return value.
*/
session_decode($sessionData);
/*
The session is not empty, and always contains a single
member: $srvsess, which should be an array containing
the contents of the session (The system was designed
before "$_SESSION" existed)
*/
if(!session_is_registered("srvsess")) {
return "This session does not show any valid data!";
}
}
?>
Tom Brown
An online Starcraft RPG? Only at:
http://www.netnexus.com/
Here is a sample session that I have been using:
srvsess|a:3:{s:3:"pin";s:10:"12345ABCDE";s:4:"name";s:9:"Tom Brown";s:4:"code";s:12:"124563326488";}