title: cakephp - auth logout redirect
body: <p>In cakephp2.0, I have <strong>domain.com</strong> but when I logout (url is <strong>domain.com/logout</strong>), it is redirected to <strong>domain.com/app/login</strong>. I dont want it to redirect to <strong>domain.com/app/login</strong> but instead redirect to <strong>domain.com/logout</strong>. These are the codes I have in my UsersController &amp; my AppController</p>
  
  <pre><code>class AppController extends Controller {
  public $helpers = array ('Html', 'Form', 'Js' =&gt; array('Jquery'), 'Session');
  
  public $components = array(
      'Session',
      'Auth' =&gt; array(
          'loginRedirect' =&gt; array('controller' =&gt; 'posts', 'action' =&gt; 'index'),
          'logoutRedirect' =&gt; array('controller' =&gt; 'users', 'action' =&gt; 'login'),
           'authorize' =&gt; array('Controller') // Added this line
      )
  );
  }
  </code></pre>
  
  <p><strong>Userscontroller</strong></p>
  
  <pre><code>class UsersController extends AppController {
  public $components = array(
  
      'Auth' =&gt; array(
          'loginRedirect' =&gt; array('controller' =&gt; 'posts', 'action' =&gt; 'index'),
          'logoutRedirect' =&gt; array('controller' =&gt; 'users', 'action' =&gt; 'login'),
           'authorize' =&gt; array('Controller') // Added this line
      )
  );
  
  public function beforeFilter() {
      parent::beforeFilter();
      $this-&gt;Auth-&gt;allow('add', 'logout', 'login');
      $this-&gt;Auth-&gt;deny('view');
  }
  
  public function login() {
      if ($this-&gt;request-&gt;is('post')) {
          if ($this-&gt;Auth-&gt;login()) {
  
              $this-&gt;redirect('http://domain.com/thankyou');
          } else {
              $this-&gt;Session-&gt;setFlash(__('Invalid username or password, try again'));
          }
      }
  }
  
  public function logout() {
      $this-&gt;redirect($this-&gt;Auth-&gt;logout());
  }
  }
  </code></pre>
  
  <p>Any help would be great. Thanks.</p>