Hi I'm using cakephp auth component for login system, I would like,every time when user login to redirect him to users page,but when session is timeout and user login again he is redirected to previous page that he was on,and not back to users page.I hope you understand me.He is my code.
app controller :
function beforeFilter() {
$this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('admin' => false, 'controller' => 'books', 'action' => 'index');
$this->Auth->allow('display');
}
users controller :
function login() {
}
function admin_logout() {
$this->Session->destroy();
$this->redirect($this->Auth->logout());
}