title: CakePHP Auth login redirecting to wrong places
body: <p>My application is set up to always redirect to a login screen.  The login and logout redirects are driving me nuts though.</p>
  
  <p>When I actually login, first it will redirect to the logout URL, then if I login a second time it will redirect to the home page correctly.  Then when I log out, it redirects to the login URL and not the logout URL.</p>
  
  <p><strong>In the app_controller.php</strong></p>
  
  <pre><code>public function beforeFilter() {
      $this-&gt;Auth-&gt;userModel = 'User';
      $this-&gt;Auth-&gt;loginAction = '/users/login';
      $this-&gt;Auth-&gt;loginRedirect = '/home';
      $this-&gt;Auth-&gt;logoutRedirect = '/users/login/1';
      $this-&gt;Auth-&gt;authError = 'You must be logged in to view this page.';
  }
  </code></pre>
  
  <p><strong>And in the users_controller.php</strong></p>
  
  <pre><code>public function login($loggedout = false) {
      if ($this-&gt;Session-&gt;check('Message.auth')) {
          $this-&gt;Session-&gt;setFlash('Incorrect username or password.', 'default', array('class' =&gt; 'msg error'), 'auth');
      } elseif ($loggedout) {
           $this-&gt;Session-&gt;setFlash('You have been logged out.', 'default', array('class' =&gt; 'msg success'), 'auth');
      }
  }
  
  /**
   * Logout action
   */
  public function logout() {
      $this-&gt;redirect($this-&gt;Auth-&gt;logout());
  }
  </code></pre>
  
  <p>I have no idea what is going wrong.  It seems like a pretty simple component to use.  I am new to CakePHP by the way.</p>
  
  <p>basically, login should redirect to /home, and logout should redirect to /users/login/1 so I can display the "you have been logged out" message above the login form again.  That is literally all I need to do.</p>