Re: HTTP_Session using DB

From: Date: Thu, 07 Apr 2005 13:28:59 +0000
Subject: Re: HTTP_Session using DB
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18632@lists.php.net to get a copy of this message
"Dan Rossi" <pear@electroteque.org> wrote in message news:03b3ba7caaf1ebb93128914612fbfc43@electroteque.org... > > On 07/04/2005, at 12:44 PM, Rob Agar wrote: > > > > was your session data stored in a database? It seems to work well as > > a > > OO wrapper for the the standard php, but I want to store the session > > data in a DB so it can be shared between hosts... > > > > cheers > > Rob > > > > > > I would check out a session deamon in that case, i'm not so fond of > sessions via db. Hi Dan, I've been using HTTP_Session with the DB container (MySQL) in lots of projects like this: HTTP_Session::useCookies(false); HTTP_Session::setContainer('DB', array('dsn' => $dsn, 'table' => TABLE_SESSIONS, 'autooptimize' => true)); HTTP_Session::start(SESSION_NAME); HTTP_Session::setExpire(SESSION_LIFETIME); Most times combined with LiveUser (read: let LiveUser do the idle/expire checks). It even works with session_regenerate_id(). One thing to look out for is that the value for HTTP_Session::setExpire() should not be 0 - this doesn't seem to work. What kind of problem do you have? Best regards, Torsten Roehr

« previous php.pear.general (#18632) next »