$mb = new member(); $mb->db=$this->db; if($mb->checkcookie()) { $auth = Zend_Auth::getInstance(); $authAdapter = new Zend_Auth_Adapter_DbTable($this->db); $authAdapter->setTableName('users') ->setIdentityColumn('username') ->setCredentialColumn('password'); $authAdapter->setIdentity($mb->user)->setCredential($mb->srpwd); $result = $auth->authenticate($authAdapter); if ($result->isValid()) { $data = $authAdapter->getResultRowObject(null,'password'); $auth->getStorage()->write($data); } }