我开发了一个简单的 Cake 应用程序,在完成编码后,我将它上传到我的 Web 服务器,现在它有几个问题(它在 localhost 上就像一个魅力):
setFlash
消息不起作用(我在数据库中使用会话,并且有一些会话的记录cake_sessions
)- 成功登录后,它会再次将我重定向到登录页面。
- 有时缓存文件会消失!(我的
tmp
文件夹是可写的)
实际上,在登录之前不允许任何操作,但您应该You are not authorized to access that location.
在登录页面顶部看到一条闪烁消息,但它不会出现,但是如果您使用错误的用户名/密码登录,它会显示一条消息(wth?
)
UsersController 的登录和注销方法:
public function login() {
if ($this->request->is('post')) {
if ($this->Auth->login()) {
$this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash(__('Invalid username or password, try again'));
}
}
}
public function logout() {
$this->redirect($this->Auth->logout());
}
最近执行的 100 个查询(来自日志):
SELECT `Session`.`id`, `Session`.`data`, `Session`.`expires` FROM `srv`.`cake_sessions` AS `Session` WHERE `id` = '7orjo8clp192qeie55k6pqro26' LIMIT 1