我的Zend_Auth
函數有問題。Zend會話使用失敗登錄擦除
我有一個網絡應用程序,當Zend_Auth
會話中的密鑰超時時提示用戶使用登錄框。當用戶使用正確的憑證登錄時,會話中的密鑰重置爲true。但是,當用戶輸入錯誤的憑證時,會話中的所有密鑰都將被擦除,並且會話的有效期更長?
我在想,如果Zend_Auth::getInstance()
函數是擦拭它開始新鮮?
任何想法?
protected function _process($values)
{
// grab data from config
$iniTime = Zend_Registry::get('config')->inactive->session;
$expireTime = $iniTime->timeout;
$realIP = new Application_Model_RealIP();
// Get our authentication adapter and check credentials
$adapter = $this->_getAuthAdapter();
$adapter->setIdentity($values['email']);
//$pwEncode->encode_password($values['password'])
$adapter->setCredential($values['password']);
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($adapter);
if ($result->isValid()) {
$user = $adapter->getResultRowObject();
$user->session_IP = $realIP->getRealIpAddr();
$auth->getStorage()->write($user);
//check whether the client is authenticated
$session = new Zend_Session_Namespace('new_session');
// Set "dummy" key with expiration
$session->key = true;
$session->setExpirationSeconds($expireTime, 'key');
return true;
}
return false;
}
鏈接調用_process方法link
如果身份驗證失敗,您的authAdapter會執行什麼操作,因爲在您的_process()函數中,您只是返回false,或者如果_process()返回FALSE,您的登錄控制器會執行什麼操作? – RockyFord
嘿,感謝您的快速回復,這裏是調用_process方法的功能 [link](http://paste.laravel.com/5wQ) 它應該只是記錄一個審計事件併發回一個json給用戶的消息給出錯誤信息。 – Perceptive