tags:

views:

89

answers:

2

I have a weird problem with PHP4

I have a class which assigns a $_SESSION variable.

On the local dev server it works as: $_SESSION['foo'] = $this->foo; and I can access $_SESSION['foo'] as a string.

on the live server $_SESSION['foo'] is not a string but a serialized object? the same code?

A: 

I didn't know much about this, but as far i use PHP, PHP 4 have some problem with $_SESSION (and $_SERVER etc) variable(s) and you better stick with the old way creating & storing session (i forgot about it btw). And what make problem was it have bugs in it's Object Oriented model.

Then i stick with PHP 5 works fine, you should consider migrating your application into PHP 5 too :D

Dels
+2  A: 

ok, I found out $_SESSION['myvar'] becomes a global $myvar, and was being overritten by the instance variable $myvar = new MyClass();

Lol, good old global vars.
Darryl Hein