I am able to change the session lifetime using session_gc*, but what desired behavior is:
1. user logins without clicking the 'remember me' checkbox then their session TTL should be the default 1440 2. if the user clicks the 'remember me' checkbox then they session TTL should be overridden to use 2592000 This works no problem if I use the default file system session handler, but not with the database handler. On Wed, Nov 12, 2008 at 3:22 AM, till <[EMAIL PROTECTED]> wrote: > On Tue, Nov 11, 2008 at 6:19 PM, kwylez <[EMAIL PROTECTED]> wrote: > > > > In a global config file I have setup my zend session options: > > > > <!-- config snippet --> > > <session> > > <params> > > <save_path>/var/www/zend_sessions/</save_path> > > <!-- Remember session for one month --> > > <remember_me_seconds>2592000</remember_me_seconds> > > </params> > > </session> > > > > <!-- end config snippet --> > > > > > > /** > > * Set the Zend session options (global config) > > */ > > Zend_Session::setOptions($globalConfig->session->params->toArray()); > > > > In my bootstrap I am passing my zend session db information to the > session > > handler: > > > > /** > > * Zend Session handling will be turned over to the database instead > of > > the file > > * system. > > * > > * NOTE: this config is also passed to Zend_Db_Table so anything > specific > > * to the table can be put in the config as well > > */ > > $sessionConfig = array( > > 'name' => 'sjcrh_session', //table name as per > > Zend_Db_Table > > 'primary' => array( > > 'session_id', //the sessionID given by php > > 'save_path', //session.save_path > > 'name' //session name > > ), > > 'primaryAssignment' => array( //you must tell the save handler > which > > columns you > > //are using as the primary key. > ORDER > > IS IMPORTANT > > 'sessionId', //first column of the primary key is of > > the sessionID > > 'sessionSavePath', //second column of the primary key is > the > > save path > > 'sessionName' //third column of the primary key is the > > session name > > ), > > 'modifiedColumn' => 'modified', //time the session should > > expire > > 'dataColumn' => 'session_data', //serialized data > > 'lifetimeColumn' => 'lifetime', //end of life for a > specific > > record > > ); > > > > /** > > * Tell Zend_Session to use your Save Handler > > */ > > Zend_Session::setSaveHandler(new > > Zend_Session_SaveHandler_DbTable($sessionConfig)); > > > > > > Everything works great at this point. I can start my sessions (user > login) > > and see the information in the database. My question is how do I get the > > session lifetime to change from the default, 1440 seconds, to the > > remember_me_seconds, 2592000. > > > > In my login script I check to see if a user as selected the "remember me" > > checkbox so their session TTL is extended. > > > > I have tried a variety of ways, but when I query the lifetime column it > > still remains 1440. > > > > Look into session.gc_* > <http://docs.php.net/manual/en/session.configuration.php> > -- Cory Wiles [EMAIL PROTECTED] http://www.corywiles.com http://www.400mtogo.com
