title: php wordpress password change - logging me out!
body: <p>I'm trying to build a simple wordpress password change script of my own (well, based on a plugin really) - the password is successfully changed - but it logs me out after the change completes! Below is the code used. Can anyone see where I'm being logged out and how to prevent it? Thanks!</p>
  
  <pre><code>$update = $wpdb-&gt;query($wpdb-&gt;prepare("UPDATE {$wpdb-&gt;users} SET `user_pass` = %s WHERE `ID` = %d",array(wp_hash_password($_POST['admin_pass1']),$user_ID)));
  
  if(!is_wp_error($update))
  {
      wp_cache_delete($user_ID,'users');
      wp_cache_delete($user-&gt;user_login,'userlogins');
      wp_logout();
      if (wp_signon(array('user_login'=&gt;$user-&gt;user_login,'user_password'=&gt;$_POST['admin_pass1']),false)):
          wp_redirect(admin_url());
      endif;
      ob_start();
  }
  </code></pre>