title: CakePHP Auth Component Not logging in when using $this->Auth->login();
body: <p>I'm new to cakePHP and I have read their documentation and I'm following their simple authentication example. I've also searched far and wide (including answers on this site) for an answer to my problem.</p>
  
  <p>I'm using cakePHP 2.0 and my UsersController's login function looks like this:</p>
  
  <pre><code>function login() {
      if ($this-&gt;request-&gt;is('post')) {
          if ($this-&gt;Auth-&gt;login(/*$this-&gt;request-&gt;data*/)) {
              $this-&gt;redirect($this-&gt;Auth-&gt;redirect());
          }else {
              $this-&gt;Session-&gt;setFlash(__('Invalid username or password, try again'));
          }
      }
  }
  </code></pre>
  
  <p>My AppController looks like this:</p>
  
  <pre><code>public $components = array(
                      'Session',
                      'Auth' =&gt; array(
                              'loginRedirect' =&gt; array('controller' =&gt; 'pages', 'action' =&gt; 'display'),
                              'logoutRedirect' =&gt; array('controller' =&gt; 'pages', 'action' =&gt; 'display')
                      )
          );
  
  public function beforeFilter() {
      $this-&gt;Auth-&gt;loginAction = array('controller' =&gt; 'users', 'action' =&gt; 'login');
  }
  </code></pre>
  
  <p>My User Model:</p>
  
  <pre><code>class User extends AppModel {
  
  public $name = "User";
  
  }
  </code></pre>
  
  <p>And the login form:</p>
  
  <pre><code>echo $this-&gt;Session-&gt;flash('auth');
  echo $this-&gt;Form-&gt;create('User', array('action' =&gt; 'login'));
  echo $this-&gt;Form-&gt;input('username');
  echo $this-&gt;Form-&gt;input('password');
  echo $this-&gt;Form-&gt;end('Login');
  </code></pre>
  
  <p>The problem is it doesn't log a user in. When $this->Auth->login() is called without $this->request->data as a parameter nothing is written in the session and the page just refreshes.However when you supply the $this->request->data it works, credentials are written to the session and I'm redirected correctly. However I've noticed that you can 'log in' anyone with $this->Auth->login($this->request->data) even if they are not present in the database. In addition to this, if I enter wrong credentials nothing happens, no flash messages are displayed.</p>
  
  <p>I'm not trying to do anything special, all I want is the ability to log a user in. I have a simple users table with username and password fields and I have followed their example and read their documentation, but still nothing I have tried has worked.</p>
  
  <p>I apologise if I have not supplied all the information needed to provide a response. Any help is greatly appreciated.</p>