0

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?

2 Answers2

2

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

Tom11
  • 2,419
  • 8
  • 30
  • 56
0

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,375
  • 9
  • 39
  • 59