Session variables getting over-written

software development

#1

I’m running PHP4 (as CGI) and have recently noticed a problem with my session variables that wasn’t there a week ago. I’ve got a bunch of data stored in session (eg. $_SESSION[‘stuff’]) and noticed that any PHP code that sets a variable with the same name as the index (eg. $stuff) is wiping-out the session variable. Does anyone know if there is a PHP setting that is causing this (like register_globals)? I’ve tried changing several PHP settings using the ini_set method without any luck. Could there have been a change in the PHP4 set-up on DreamHost that might have caused this to start happening? Any help or suggestions would be very appreciated.


#2

Without doing the init_set call, try making a page that calls php_info to see what the settings are.

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#3

Can do. Got it here…
http://admin.freezerbox.com/phpinfo.php


#4

Of course it is register_globals, and using ini_set() won’t work - it is too late!

You’ll need to either switch to PHP 5 if you can, or follow these directions but modify them to turn off register_globals:

http://wiki.dreamhost.com/index.php/PHP.ini

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#5

Thanks Atropos7. I really appreciate the help.