Title: login hook (wp_login?)
Last modified: August 19, 2016

---

# login hook (wp_login?)

 *  [kbradwick](https://wordpress.org/support/users/kbradwick/)
 * (@kbradwick)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/login-hook-wp_login/)
 * I am writing a plugin that tracks user sessions so I can get statistics on who
   is logged in now along with length of time of their session. I need to write 
   a cookie upon every succesfull login attempt but I don’t know what hook to use?
 * I have tried wp_login but $current_user is not set so I cannot access the logged
   in persons ID. I’ve also tried wp_authenticate but again inappropriate.
 * Any ideas what hook to use?

Viewing 1 replies (of 1 total)

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/login-hook-wp_login/#post-1116592)
 * download a plugin like
    [http://wordpress.org/extend/plugins/wassup/](http://wordpress.org/extend/plugins/wassup/)
   and see how they do it

Viewing 1 replies (of 1 total)

The topic ‘login hook (wp_login?)’ is closed to new replies.

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Samuel B](https://wordpress.org/support/users/samboll/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/login-hook-wp_login/#post-1116592)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
