Re: Storing objects in sessions recursively

From: Date: Mon, 27 Nov 2006 11:13:21 +0000
Subject: Re: Storing objects in sessions recursively
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-245174@lists.php.net to get a copy of this message
Dave M G wrote: > Vincent, Jochem, > > Thank you for replying. > > The issue turned out to be my Article class took arguments in its > constructor, which was unacceptable because the argument could not be > serialized when being passed along during the session. why would the arguments need to be serialized? unserializing an object is not the same as constructing a new one. > > By adjusting my object so that the constructor takes no arguments, and > then creating a new method on the object to do what the constructor did > previously, the problem was solved. are the Article arguments used to setup a DB connection (or something like that) per chance? > > That explanation may be confusing, but that's because I don't fully > understand serialization myself yet. All I can say for sure is that the > problem was definitely a serialization issue. >

« previous php.general (#245174) next »