May i ask what the advantage of storing objects in session is ? Does it cause overhead ? Like should i store the most common classes like the db and auth class in a session ?
No. A good time for storing an _object_ in the session is when the object contains mostly data. Restoring the object on the next page recreates that data.
There's no benefit if the object is just full of methods, as you have to include the class before hand, anyhow. It's no different than just making a new "db" or "auth" class when the page loads.
Even if the object is stored in the session, you have to include the class code before hand so PHP knows how to load the object.
Does that make sense?
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php