Re: SessionManager

From: Date: Wed, 27 Jun 2001 17:28:07 +0000
Subject: Re: SessionManager
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-505@lists.php.net to get a copy of this message
On Wed, Jun 27, 2001 at 05:07:45PM +0200, Hans Westerbeek wrote: > $sesMgr = new SessionManager(); > $myFoo = new Foo("blah"); // construct a Foo object > $mySesMgr->addVar("myFoo ", $myFoo); // register the object > // ... perform actions with the myFoo object that changes its inner state > > Then you can get that object back from the session at any time, and can > keep track of all of the registered variables more easily, since they're > all in one place. Internally SessionManager will have an array that it > registers with session_register(). In this array it stores all of the > variables. Okay, I think I have a better idea of what you're suggesting. In Horde, we just use the standard session_* functions and write classes around them when we require additional functionality. For example, here's a link to our SessionCache class, which allows us to cache objects using PHP 4 sessions: http://cvs.horde.org/cvs.php/horde/lib/SessionCache.php -- Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology http://www.csh.rit.edu/~jon/ : Computer Science House Member

« previous php.pear.dev (#505) next »