Re: Creation and transfer of object thru session

From: Date: Mon, 27 Mar 2006 01:34:08 +0000
Subject: Re: Creation and transfer of object thru session
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-232576@lists.php.net to get a copy of this message
Peter Lauri wrote:
Hi, I am creating an object from a Web Service. Throughout a session I would like to keep the object that was created in the beginning of the session. The reason for this is that the creation of the object takes some time because of the communication with the Web Service. As I see it, there are two possibilities: 1. Save the object in the $_SESSION variable, because the objects are not big 2. Serialize the object and save it to a database, and use $_SESSION to keep reference to the database What is to prefer? What are the benefits of using 1 against using 2? Is there any 3rd option?
I'd probably go with #1 mainly because it's always available through $_SESSION - you don't have to hit the db to keep getting it. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#232576) next »