This is what I did:

1) After user login, if the Zend_Auth_Adapter_DbTable is valid, then add the
extra data (userid) to my data column of the session table:

$adapter = $this->getAuthAdapter($db, $this->view->form->getValues());
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($adapter);
                        
// The user provided by credentials.
if($result->isValid()) {
     $storage = $auth->getStorage();
     // ADDS THE SERIALIZED VALUES OF id and username to data column of
session table.  (id is user id)
     $storage->write($adapter->getResultRowObject(array('id', 'username')));
} 

2)  Extract the data

$storage = Zend_Auth::getInstance()->getStorage();
$storage = $storage->read();
echo $storage->id;
echo $storage->username;


-- 
View this message in context: 
http://n4.nabble.com/Is-saving-userId-in-a-session-database-table-possible-Zend-Session-SaveHandler-DbTable-tp1359860p1568316.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to