Reputation:
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?
Upvotes: 0
Views: 193
Reputation:
OK, I found out that $_SESSION['myvar']
becomes a global $myvar
, and was being overritten by the instance variable $myvar = new MyClass();
Upvotes: 2
Reputation: 2425
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
Upvotes: 0