Are there known problems with serialization? Specifically, I am trying to use an object to hold information for pages within a session and am having GREAT (> 25 hours so far) difficulty in getting it to work. The object that I'm trying to serialize/unserialize consists of a class that has, itself, instantiated other classes (more like composition than inheritance).
I've tried using a session variable but that didn't work, so I am now doing it myself (writing the serialized variable to a file and then unserializing it).
What happens is that when I serialize/unserialize this, part [not all] of the object that I get back is corrupted.
Here is a code fragment to illustrate the problem:
class pm
{
var $compclass;
function pm()
{
$this->compclass = new subclass();
}
}
class subclass
{
etc.
}
When I serialize/unserialize this between hits in a session, the $this->compclass variable appears to get clobbered. This behavior is inconsistent, some variables get clobbered some don't.
When PHP reloads a page within a session, does it sometimes put objects in different places--thereby making it impossible to reset your information??
I know this is a long note--any help at all GREATLY appreciated.