Cakephp注销和重新定向在hostgator中不起作用
昨天一切都很好,但今天注销功能不再工作,对路径/用户的访问不再有效,但当我运行/users/index时,它的work在这里是一个解释视频和我的代码 类UsersController扩展了AppController{Cakephp注销和重新定向在hostgator中不起作用,php,cakephp,Php,Cakephp,昨天一切都很好,但今天注销功能不再工作,对路径/用户的访问不再有效,但当我运行/users/index时,它的work在这里是一个解释视频和我的代码 类UsersController扩展了AppController{ function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('login','add'); $this->Auth->authEr
function beforeFilter()
{
parent::beforeFilter();
$this->Auth->allow('login','add');
$this->Auth->authError = __('Vous devez être connecté.');
$this->Auth->loginError = __('E-mail ou mot de passe invalide, veuillez réessayer');
}
function login()
{
if ($this->request->is('post'))
{
if ($this->Auth->login())
{
$this->redirect(array('action' => 'view'));
}
}
}
public function logout()
{
$this->Auth->logout();
$this->redirect(array('action' => 'login'));
}
public function index()
{
$this->paginate = array(
'limit' => 1000,
'order' => array(
'User.id' => 'desc'
));
$this->User->recursive = 0;
$this->set('users', $this->paginate());
}
AppController.php
class AppController extends Controller
{
var $components = array('Auth','Session');
function beforeFilter()
{
//$this->Auth->allow(array('*'));
}
}
在我的Heberger中,我有PHP5.6.29
cake的版本是2.3.4用controller和app controller粘贴完整代码
请确保您不允许在before筛选器中使用该函数。是的,我在hostgator服务器上遇到了相同的问题。我正在尝试解决该问题。当前会话未被破坏,缓存未被清除。通常cakephp不会将登录和注销放在缓存中。您的注销在appController中如何重定向?发布在代码也。我添加了appcontroller和userscontroller,但网站在我的本地和服务器上都有很好的工作,现在坏了,我什么都不碰。我添加了appcontroller和userscontroller,但网站在我的本地和服务器上都有很好的工作,现在坏了,我不想uch Anything是的,你有理由如果你得到了解决方案,请帮助meCookie正在本地设置localhost,这就是live server注销不起作用的原因。我尝试了不同的计算机,但我没有开发应用程序,注销效果很好。