php - zend: storing sessions in a database when using multidb -


my zend application uses multiple database connections, used multidb resource configure several connections in application.ini file.

now want store application sessions database, using zend_session_savehandler_dbtable, can't find way specify of connections use in order access database.

every examples found on net uses db resource , relies on default database adapter. unfortunately, sessions have stored in database not default one...

how specify db use storing session ?

although not specified in zend documentation, constructor zend_session_savehandler_dbtable class accepts parameter named db specifies database connection use.

$db = $this->getpluginresource('multidb')->getdb('zend'); $config = array(     'db'             => $db,     'name'           => 'session',     'primary'        => 'id',     'modifiedcolumn' => 'modified',     'datacolumn'     => 'data',     'lifetimecolumn' => 'lifetime' ); zend_session::setsavehandler(new zend_session_savehandler_dbtable($config)); zend_session::start(); 

i not able specfy settings in application.iniconfiguration file, though...


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -