I’m using the auth component and I don’t want the login page to be accessible once the user has logged in, it should only be accessed by anonymous users. What can I put in my login method to accomplish this? I’ve tried this:
if (isset($this->Auth->user('id')) {
$this->redirect('/profile/');
}
But I get the following error:
Fatal error: Can’t use method return value
1 Answer