setting and extending Session Lifetime using Zend_Auth

xpress

New Member
i use Zend_Auth for one of my Projects, but so far haven't figured out how to set the Lifetime for the Session, or how to extend it (lets say it should run 5 minutes and should reset to that when the user makes an action), here is my Initialization code:\[code\] $authAdapter = new Zend_Auth_Adapter_DbTable($this->_model->pdo); $authAdapter->setTableName('normal_folks') ->setIdentityColumn('username') ->setCredentialColumn('password'); $post = $this->_request->getPost(); $authAdapter->setIdentity($post['username']) ->setCredential($post['password']); $auth = Zend_Auth::getInstance(); $result = $auth->authenticate($authAdapter); if($result->isValid()) { $userInfo = $authAdapter->getResultRowObject(null, 'password'); $authStorage = $auth->getStorage(); $authStorage->write($userInfo); if(strlen($post['refferer']) > 1){ header("Location: ".$post['refferer']); }elseif(strlen($this->_request->getParam('ref_action')) > 1){ Zend_Controller_Action::_forward($this->_request->getParam('ref_action'),"admin",null,null); }else{ Zend_Controller_Action::_forward("index","admin",null,null); } }\[/code\]Ant this how i check if the user is logged in:\[code\] if(Zend_Auth::getInstance()->hasIdentity()){ echo "Woho!"; }else{ die("invalid-identity"); }\[/code\]Its probably right there in front of me but I just can't figure it out, help? Please? Pretty Please? :D
 
Back
Top