Re: [PHP] Creation and transfer of object thru session

2006-03-26 Thread Chris

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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Creation and transfer of object thru session

2006-03-25 Thread Peter Lauri
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?

Best regards,
Peter Lauri

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php