我的问题是在会话空闲之后,或者在其他选项卡中,ajax请求无法工作,因为用户已经注销了。我的问题是如何验证如何将用户重定向到登录页面。我用于过滤请求的函数用于我的userscontroller类。
//class UsersController
public function beforefilter(){
parent::beforeFilter();
// Allow users to logout.
$this->Auth->allow('logout');
} 谢谢
发布于 2014-07-25 04:39:42
if (!$this->Session->read('Auth.User')) {
// redirect here
}https://stackoverflow.com/questions/24948033
复制相似问题