I really don't think you can have objects stored in sessions, maby if you searilized them when the script is terminating and then unserialized it if the session variable is set.
else { unserialize($_SESSION['object']); }
Thought there is no warranty this will work, my opinion is that it won't work since you are trying to use a variable which is pointing to an object which might or might not be there or the object might have changed since last time. What if the user comes back after some time when you have changed the class, but the object you saved in the session is the old one (which now breaks other functions as it doesn't work as the update class).
Use $localVar = new myClass; instead.
----------------------- http://jiart.org/ My digital playground with it's own sandbox. Well anyway, I love programming
else
{
unserialize($_SESSION['object']);
}
Thought there is no warranty this will work, my opinion is that it won't work since you are trying to use a variable which is pointing to an object which might or might not be there or the object might have changed since last time. What if the user comes back after some time when you have changed the class, but the object you saved in the session is the old one (which now breaks other functions as it doesn't work as the update class).
Use $localVar = new myClass; instead.
-----------------------
http://jiart.org/
My digital playground with it's own sandbox.
Well anyway, I love programming