0
votes

When user comes to my site, http://xyz.com/, one of two things can happen:

  1. User not logged in
    • I want users to redirect to users/login
  2. User logged in(active session)
    • I want users to redirect to dashboard/

I've modified the routes:

Router::connect('/', array('controller' => 'users', 'action' => 'login'));

The login redirection is working fine and redirecting to dashboard, but when i click on homepage it is taking me to users/

Can anyone help me on this?

1
Could you please show us the code you are using for redirecting? Are you using the Authentication Component? I would recomend to use it, because it has a lot of built in functionality you could use. - Robert Merten

1 Answers

1
votes

Try this

$this->redirect(array('controller' => 'users', 'action' => 'login'));