ID: 8562
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: *Session related
Description: Sessions fail with Netscape

Now I remember! The bug must be in PHP because this worked with PHP 4.0 FINE!

Previous Comments:
---------------------------------------------------------------------------

[2001-01-17 04:05:02] [EMAIL PROTECTED]
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] [EMAIL PROTECTED]
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] [EMAIL PROTECTED]
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.

---------------------------------------------------------------------------

[2001-01-06 20:24:50] [EMAIL PROTECTED]
Please add a complete but short script which can be used to reproduce this
problem. 

Have you tried newer Netscape versions? 4.08 is quite old.

--Jani


---------------------------------------------------------------------------

[2001-01-05 04:31:56] [EMAIL PROTECTED]
PHP 4.0.3 was very buggy with sessions. PHP 4.0.4 works a lot better but I think I 
have discovered a bug again.

I can't find anything wrong in my code... the bug is very weird. It only happens with 
Netscape. Netscape Navigator 4.08.

When I try to login (with Netscape 4.08) in my webshop using a form generated by the 
webshop -> sessions doesn't get saved correctly. But when I press Reload -> the 
problem will be corrected. With Internet Explorer this works fine at the first time.

Here is the incorrect session data:

SESSION|a:2:{s:12:"ShoppingCart";O:12:"shoppingcart":3:{s:8:"products";a:0:{}s:9:"discounts";a:0:{}s:5:"owner";i:0;}s:12:"ClientConfig";O:12:"clientconfig":3:{s:12:"showPictures";b:1;s:14:"productsOnPage";i:10;s:8:"currency";s:3:"FIM";}}


Here is the correct one (after I press reload or first time with IE):

SESSION|a:2:{s:12:"ShoppingCart";O:12:"shoppingcart":3:{s:8:"products";a:0:{}s:9:"discounts";a:0:{}s:5:"owner";s:1:"2";}s:12:"ClientConfig";O:12:"clientconfig":3:{s:12:"showPictures";b:1;s:14:"productsOnPage";s:1:"8";s:8:"currency";s:3:"FIM";}}


They look pretty same but they are not. owner values should be 2 like in the second 
example and productsOnPage should be 8.. 0 and 10 are defaults (in the first one) but 
they are modified to 2 and 8. Somehow PHP doesn't save the modified values.. it saves 
the first values which are made by my class constructor. (I use $SESSION array which 
contains two classes)

This is very very STRANGE. Browser shouldn't have anything to do with it but it does. 
I do no browser checkups so it must be in PHP. If cookies are enabled/disabled it does 
the same thing.

And btw. This works correctly in PHP 4.0. but not in 4.03 & 4.04.

What could be wrong ?

---------------------------------------------------------------------------

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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to