我有以下的退出動作:Zend_Auth的clearidentity和由Zend_Session ::破壞造成混亂
public function logoutAction() {
Zend_Auth::getInstance()->clearIdentity();
Zend_Session::destroy();
$this->_helper->flashMessenger->addMessage(array('success' =>
_('You were successfully logged out.')));
$this->_redirect('/index/index');
}
如果我不註釋掉線:由Zend_Session :: destroy()方法我得到一個錯誤:
Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'The session was explicitly destroyed during this request, attempting to re-start is not allowed.' in /usr/local/share/php/library/Zend/Controller/Plugin/Broker.php on line 336 Zend_Session_Exception: The session was explicitly destroyed during this request, attempting to re-start is not allowed.
我已閱讀過關於這個問題的內容here和here,但仍不清楚我應該如何繼續。我應該不使用Zend_Session :: destroy()嗎?不使用它的含義和危險是什麼,以及有什麼選擇?
謝謝,我生活中可以沒有調用閃光信使。 – dimbo 2012-02-28 12:25:19