Re: Creation and transfer of object thru session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux