> > 1) In Zend_Session there are the methods remember*. These currently > > set cookie times. Would it be better to have a hook into the
> > SaveHandler so that the expire time could be changed as well? I know > > with file system it doesn't really matter, but with this DB > > implementation the future expire time is set instead of relying on the > > modified time. So, maybe keep a reference to the SaveHandler and if it > > is set, tell it to change its expire time. > 1) I agree with your thoughts concerning the remember* methods. But I > think the point is not that this implementation relies on the expiration > time instead of the modification time because this could be changed very > easily. > As Ralf Eggert already posted on > http://framework.zend.com/wiki/display/ZFPROP/Zend_Session_SaveHandler_Db+-+Jordan+Raub > > it could be useful to be able to store permanent sessions which should > be done using remember* and forgetMe hooks. While looking through the code, the remember* methods only change the time of the cookie sent to the user. There is nothing that is changed for the lifetime, which makes sense because the default file save handler only looks at modification time for garbage collection. Thats one of the strange bugs I used to get with multiple sites having different session expire times in the same session.save_path. The site with the least session.gc_maxlifetime deleted everything past the modification time. To get the functionality I wanted I had to change the session.save_path to a unique path and session.gc_maxlifetime to whatever it needed to be. > > 2) What if session.save_path is used as the default for the > > Zend_Session_SaveHandler_Db table name? I'm thinking a path in a > > file system is analogous to a table in a database. > 2) Would require the user to configure 'session.save_path' instead of > 'name' which doesn't make sense. Well the session.save_path could be a default if it is setup. While the name key in the $config array passed to the __construct method would still take precedence. If an actual path is set for session.save_path then a Zend_Session_SaveHandler_Exception would be thrown IF the 'name' configuration is not set in the $config > > 3) This one might be more contrived, session.name could be the default > > name of the data column in a Zend_Session_SaveHandler_Db database table. > 3) I think this shouldn't be implemented this way. If the user wants > this behaviour he can pass ini_get('session.name') to the configuration. The same applies here as to before. When I'm using what I've built I do the same thing I do with my Zend_Db::factory(). I use Zend_Config::toArray(), from an actual instance of course. So, if name or dataColumn is absent, the session ini directives could take over. If they fail, then throw exceptions. Thanks, Jordan
