i follow cakephp tutorial and when i log in to my account,
link of tutorial is :
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
, i can’t logout :
my code in logout method is
function logout() {
$this->Session->setFlash('Good-Bye');
$this->redirect($this->Auth->logout());
}
and login code is :
function login() {
if ($this->Session->read('Auth.User')) {
$this->Session->setFlash('You are logged in!');
$this->redirect('/', null, false);
}
}
this method is inside of users_controller .
but when i use this URL
http://localhost/newacl/users/logout
i comeback in
http://localhost/newacl/users
and i view this text
You are logged in!
therefore i can’t log out.
can you say what is happen and say what the work am i doing.
Its problem of you redirect thing you logout ..Add below code in your App_controller.php beforeFilter
In you r logout
in your login try this
hope this may help you….