Title: Reset password cookie from Plugin
Last modified: August 22, 2016

---

# Reset password cookie from Plugin

 *  [Malcolm Streeton](https://wordpress.org/support/users/malcolm-streeton/)
 * (@malcolm-streeton)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/reset-password-cookie-from-plugin/)
 * I am writing a custom user profile edit page. Currently this is done as a plugin
   accessed by a short code.
    I want to update the password. However when this is
   done the user is logged out. I tried reseting the cookie for login using wp_set_auth_cookie
   to reset it but this gives an html error as it is trying to output before the
   header is output.
 * Note being logged out although not ideal would be OK, however the ‘login with
   Ajax’ plugin I am using does not update so it is only apparent you have been 
   logged out when you go to a new page.
 * Any suggestion of how to make this work?. e.g can I include the code to reset
   the cookie in the text stream returned by the plugin function so it is output
   after the header?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [11 years, 9 months ago](https://wordpress.org/support/topic/reset-password-cookie-from-plugin/#post-5263775)
 * If you call `wp_update_user` to modify things about the user, such as the password,
   then it will handle the cookies for you.
 * Note that your function which receives the form input and does the updating must
   happen before any output occurs. Once any output happens, you can’t set cookies
   anymore because you can’t send headers. So put your processing function early,
   like on the load-$page_hook action in the admin or some such.
 *  Thread Starter [Malcolm Streeton](https://wordpress.org/support/users/malcolm-streeton/)
 * (@malcolm-streeton)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/reset-password-cookie-from-plugin/#post-5263813)
 * Thanks. However if I read it correct the load_page hook only relates to admin
   pages.
    I have the user profile on a normal page as I want to hide the wordpress
   admin area from the user.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Reset password cookie from Plugin’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [Malcolm Streeton](https://wordpress.org/support/users/malcolm-streeton/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/reset-password-cookie-from-plugin/#post-5263813)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
