PHP 4.0 Bug #8562 Updated: Sessions fail with Netscape
| From: | pojanen at pp dot htv dot fi | Date: | Fri, 23 Feb 2001 06:53:23 +0000 |
| Subject: | PHP 4.0 Bug #8562 Updated: Sessions fail with Netscape | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47324@lists.php.net to get a copy of this message | ||
ID: 8562
User Update by: pojanen@pp.htv.fi
Old-Status: Open
Status: Closed
Bug Type: *Session related
Description: Sessions fail with Netscape
I have figured a way to get around the bug. My shop would have been nicer without the around trick
though. Anyway, back to coding =)
Previous Comments:
---------------------------------------------------------------------------
[2001-02-22 04:00:43] pojanen@pp.htv.fi
Yup... did some testing. I tried all PHP version from 4.0.0 to 4.0.4pl1 and the only version which
worked correctly was 4.0.0.
Too bad.... bug or not. I don't know.
---------------------------------------------------------------------------
[2001-01-17 04:29:47] pojanen@pp.htv.fi
Now I remember! The bug must be in PHP because this worked with PHP 4.0 FINE!
---------------------------------------------------------------------------
[2001-01-17 04:05:02] pojanen@pp.htv.fi
Argghh... I don't know. Forget the cache.. It didn't help. I don't know where the bug
is. Only thing which get it working is to remove images..
---------------------------------------------------------------------------
[2001-01-17 03:36:32] pojanen@pp.htv.fi
Hours of debugging... debugging... recoding...
Result: I gues the bug is in Netscape 4.08.. not in PHP.
Reason: If I remove images from the login template it will work. It will also work if I set disk
cache to 0.
Too bad... I guess there is no way to fix this.
---------------------------------------------------------------------------
[2001-01-08 03:00:46] pojanen@pp.htv.fi
I have tried to get around the problem..
Now it always registers the session but it looses a lot of data (classes). Sometimes it works ok..
after pressing reload couple of times. So the problem really is like in PHP 4.03, classes won't
be stored properly. But now it's Netscape specific.
I'm using one session variable, $SESSION. It's an array. Which contains ShoppingCart and
ClientConfig classes.
So I register the session like this...
session_start();
if(!session_is_registered("SESSION")) session_register("SESSION");
In my functions I use $SESSION as global..
global $SESSION;
And when I try to access a function..
$SESSION["ShoppingCart"]->getOwner() it says:
Fatal error: Call to a member function on a non-object in...
Sometimes it works. In IE, always.
Ofcourse I have created the classes inside the session..
like this:
if(!isset($SESSION)) $SESSION = array();
if(!isset($SESSION["ShoppingCart"])) $SESSION["ShoppingCart"] = new
ShoppingCart;
if(!isset($SESSION["ClientConfig"])) $SESSION["ClientConfig"] = new
ClientConfig;
(The first line is not so important)
Constructors of these classes set variable defaults and creates some arrays. One of the arrays
inside the ShoppingCart class constructs from ShoppingCartElement class.
Sorry, not so complete code but I hope it helps.
Btw. I have tried with Netscape 6 and it works Ok.
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
Full Bug description available at: http://bugs.php.net/?id=8562