Amr*_*ngh 3 php zend-framework
我正在使用zend框架中的web应用程序并在其中实现登录和注销编码.身份验证适配器运行良好.问题是,在身份验证和检查身份后,它会在地址栏中显示正确的重定向URL,但页面会显示错误而不是显示视图
这里是错误
致命错误:未捕获异常'Zend_Session_Exception',消息'session已由c:\ Users\amrit\_jennd\workspaces\DefaultWorkspace7\webDeveloper\library\Zend中的session.auto-start或session_start()'启动\ Session.php在第462行
Zend_Session_Exception:会话已经由第462行的C:\ Users\TranceServe\Zend\workspaces\DefaultWorkspace7\webDeveloper\library\Zend\Session.php中的session.auto-start或session_start()启动
,当我单击refresh时,它的显示正确的视图.注销代码运行良好.
这是我的zend代码
public function adminloginAction ()
{
$login = new Admin_Form_Login();
$login->setAction("adminlogin");
$login->setMethod("POST");
if (isset($_SESSION)) {
echo ("start");
} else {
echo ("not started");
}
if ($this->_request->isPost() && $login->isValid($_POST)) {
$adapter = new webDeveloper_Auth_StaffAdapter(
$this->getRequest()->getParam("email"),
($this->getRequest()->getParam("pwd")));
$result = Zend_Auth::getInstance()->authenticate($adapter);
if (Zend_Auth::getInstance()->hasIdentity()) {
$this->_redirector->gotoUrl('/admin/index');
} else {
$this->_redirector->gotoUrl('/admin/adminauthentication/adminlogin');
}
}
$this->view->form = $login;
}
Run Code Online (Sandbox Code Playgroud)
小智 5
当zend_tool用于创建项目时,它将以下行添加到application/configs/application.ini文件中:
resources.session.save_path = APPLICATION_PATH "/../data/session"
Run Code Online (Sandbox Code Playgroud)
检查此路径是否存在且应用程序是否可写.否则,Zf将使用此伪造消息向您发送此异常.