title: Cakephp Cookie issue
body: <p>I'm trying to write cookie after logging in but it doesn't seem to save anything.</p>
  
  <p>Am I doing something wrong?</p>
  
  <pre><code>function login() {
  
      if ($this-&gt;Session-&gt;read('Auth.User')) {
          if($this-&gt;data['User']['remember']){
          $cookie = array();
          $cookie['username'] = $this-&gt;data['User']['email'];
          $cookie['password'] = $this-&gt;data['User']['password'];
          $this-&gt;Cookie-&gt;write('Auth.User', $cookie, true, '+2 weeks');
          unset($this-&gt;data['User']['remember']);
          }
          $this-&gt;Session-&gt;setFlash('You are logged in!');
          $this-&gt;redirect(array('action' =&gt; 'logs'));
      } else {
  
      $this-&gt;Session-&gt;setFlash('Invalid username and password combination');
      $this-&gt;redirect('/', null, false);
  
      }
  
  }       
  </code></pre>