I am having trouble getting the Auth component do the redirects I want in a CakePHP 1.2.6 app.
I have a login form that appears on all pages and I want to keep the
Add parent::beforeFilter(); to beforeFilter in the user controller:
function beforeFilter() {
$this->Auth->autoRedirect = false;
parent::beforeFilter();
}
You can also replace the redirect with this to the login method of your user controller:
$this->redirect($this->Auth->redirect());
Auth->redirect() returns the url where the user landed before being taken to the login page or Auth->loginRedirect.