title: Reset Password Doesn't Save New Password CakePHP 2.0
body: <p>I have now got the system going through the process however for some reason, the code for actually updating the password in the database isn't updating anything? After insert new password and re-password, system immediately redirect to the login page, Even though no errors are shown?  Any thoughts? thanks.</p>
  
  <p>This is my Reset Function</p>
  
  <pre><code>function reset($token=null){
      $this-&gt;User-&gt;recursive=-1;
      if(!empty($token)){
          $u=$this-&gt;User-&gt;findBytokenhash($token);
          if($u){
              $this-&gt;User-&gt;id=$u['User']['id'];
              if($this-&gt;request-&gt;is('post')){
                  $this-&gt;User-&gt;data=$this-&gt;request-&gt;data;
                  $this-&gt;User-&gt;data['User']['username']=$u['User']['username'];
                  $new_hash=sha1($u['User']['username'].rand(0,100));//created token
                  $this-&gt;User-&gt;data['User']['tokenhash']=$new_hash;
                  // print_r($this-&gt;request-&gt;data);
                  //      exit;
                  if($this-&gt;User-&gt;validates(array('fieldList'=&gt;array('password','password_confirm')))){
                      if($this-&gt;User-&gt;save($this-&gt;User-&gt;data)){
                          $this-&gt;Session-&gt;setFlash('Password Has been Updated');
                          $this-&gt;redirect(array('controller'=&gt;'users','action'=&gt;'login'));
                      }
                  } else{
                      $this-&gt;set('errors',$this-&gt;User-&gt;invalidFields());
                  }
              }
          } else {
              $this-&gt;Session-&gt;setFlash('Token Corrupted,,Please Retry.the reset link work only for once.');
          }
      } else{
          $this-&gt;redirect('/');
      }
  }
  </code></pre>
  
  <p>And this is my reset.ctp</p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;create('User', array('action' =&gt; 'reset')); ?&gt;
  &lt;?php
      if(isset($errors)){
          echo '&lt;div class="error"&gt;';
          echo "&lt;ul&gt;";
          foreach($errors as $error){
              echo "&lt;li&gt;&lt;div class='error-message'&gt;$error&lt;/div&gt;&lt;/li&gt;";
          }
          echo "&lt;/ul&gt;";
          echo '&lt;/div&gt;';
      }
  ?&gt;
  &lt;form method="post"&gt;
      &lt;?php
          echo $this-&gt;Form-&gt;input('User.password', array('type' =&gt; 'password',
                                                         'name' =&gt; '$data[User][password]',
                                                         'class' =&gt; 'form-control'));
          echo $this-&gt;Form-&gt;input('User.re_password', array('type' =&gt; 'password',
                                                          'name' =&gt; 'data[User][re_password]',
                                                          'class' =&gt; 'form-control'));
      ?&gt;
      &lt;input type="submit" class="button" style="float:left;margin-left:3px;" value="Save" /&gt;
      &lt;?php echo $this-&gt;Form-&gt;end();?&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Please, help me , thanks</p>