On 5/27/11 6:11 PM, Aaron Luman wrote:
> The question is, is storing this object in the $_SESSION array good
> practice?  Or is it better to pull the data fresh from the database
> on each page load?

As long as your $_SESSION array doesn't get huge, it's generally better 
to keep it in the session.  The exception would be if the information is 
likely to change in the database during the session, and if it matters 
if the user has the most up-to-date information.

An alternative would be to use something like HandlerSocket to get the 
information out of the database in memcache-like speed.  Then you'd 
always have the most up-to-date information, but the catch would be how 
long it takes to build the object from the data.

Steve

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to