Title: Reset Login Timer
Last modified: August 20, 2016

---

# Reset Login Timer

 *  [clwill](https://wordpress.org/support/users/clwill/)
 * (@clwill)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/reset-login-timer/)
 * Writing a plugin that relies on the user being logged in to access a number of
   features. The login expires after a period of time (24 hrs?). I want to have 
   it reset if/when there is any activity – can be just a page load doesn’t have
   to be anything fancy.
 * I know the user is an authorized user at this point, and I have their userid,
   so I don’t want/need to do anything as complex as a login. Was thinking of adding
   some code into my page header to reset the cookies and tried wp_user_settings()
   with WP_ADMIN set to true, but that doesn’t seem to set the cookies, just check
   them.
 * Just looking through things and I see that it looks like wp_set_auth_cookie()
   is the thing I want. I see that in user.php, there is a case where it does:
 *  wp_clear_auth_cookie();
    wp_set_auth_cookie($ID);
 * Does this seem like a good approach? Anyone know any problems/issues here?
 * Thanks in advance,
    Chris

The topic ‘Reset Login Timer’ is closed to new replies.

## Tags

 * [login](https://wordpress.org/support/topic-tag/login/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [clwill](https://wordpress.org/support/users/clwill/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/reset-login-timer/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
