2
晚上好,我有這段代碼,但是我需要知道這是否真的記錄了,但沒有成功,我錯了?這scritp沒有告訴我任何錯誤:(使用Zend_Auth驗證會話的問題
$userDetails = array('foo' => 'bar');
$storage = new Zend_Auth_Storage_Session();
// set sorage for Zend_Auth
Zend_Auth::getInstance()->setStorage($storage);
// write data to the storage
Zend_Auth::getInstance()->getStorage()->write($userDetails);
// read data from storage
$c = Zend_Auth::getInstance()->getStorage()->read();
$result = $c->authenticate($userDetails);
echo $this->view->form = var_dump($result);
if (!$result->isValid()){
var_dump('FAILURE');
}else{
$this->_helper->redirector('index','index');
}
你想檢查是否用戶會話存在?? –
是!................. – user3680708