Everything was fine on my personal system until I uploaded to the remote server... then my sessions stopped working. I realized that on the remote server, register_globals was set to "on", whereas it's set to "off" on my personal system.
So.. when I try the following:
this works on my personal system with register_globals = Off, but on my remote system, $_SESSION['user'] is upcast to an object of type stdClass on the next page/request. I read somewhere in the docs that this can happen when serializing an object without including type information, and that session vars are serialized and deserialized.
I see a few choices in front of me... either I go with ini_set("register_globals"
on every page, or session_register("id"
and use $id on every page. I'd rather not do either... I don't want to have to change an config value all the time, nor do I want to use a global variable like $id when I have a perfectly good global array $_SESSION.
Is there a third alternative (or a 4th, 5th, or 6th)? Which would someone recommend?
Thanks all... Liam Morley
lmorley@gdc.wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
So.. when I try the following:
Code:
$_SESSION['user'] = $id;
this works on my personal system with register_globals = Off, but on my remote system, $_SESSION['user'] is upcast to an object of type stdClass on the next page/request. I read somewhere in the docs that this can happen when serializing an object without including type information, and that session vars are serialized and deserialized.
I see a few choices in front of me... either I go with ini_set("register_globals"
Is there a third alternative (or a 4th, 5th, or 6th)? Which would someone recommend?
Thanks all... Liam Morley
lmorley@gdc.wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."