再会,
我正在使用 Zend 测试用户身份验证,但现在我已经登录,然后我再次注销它让我保持登录状态,所以我无法测试以确保它正常工作。
我用:
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity())
它总是让我拥有一个身份并允许我查看资源。
是否可以在注销时清除缓存、会话或 cookie,或者在不取消注释行等的情况下进行彻底测试的方法。
谢谢
登出:
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity())
$auth->clearIdentity();
$this->_redirect('/');