How can I make the login and logout methods recharge the entire site?


#1

This way I only load the view in question, I want to recharge the entire page.

public function login() {
       ......
       if($this->Auth->user()) {
         return $this->redirectUrl();
       }
 }

     public function logout() {
       return $this->redirect($this->Auth->logout());
     }

#2

What do you mean by recharge?


#3

by recharge I am assuming you want to reload the same page where the user has logged out. If that is correct you can do…

$this->Auth->logout();
$this->redirect($this->referer());