Title: Programmatically login
Last modified: August 18, 2017

---

# Programmatically login

 *  [WORX Developer](https://wordpress.org/support/users/developeratworx/)
 * (@developeratworx)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/programmatically-login/)
 * Dear UM-Team,
 * does your Plugin uses the default wp_set_auth_cookie functionality?
    I ask this
   because I’m struggeling with the implementation of programmatic login (a login
   without having to fill username and password in a field). There are some scripts
   about this but none of them works. So I figured that maybe your plugin does something
   additional at the login beside the default WP stuff.
 * Or do you have any suggestion how to implement a programmatic login with UM?
 * Sample code:
    //get user’s ID $user = get_user_by(‘login’, $loginusername); $
   user_id = $user->ID; //login wp_set_current_user($user_id, $loginusername); wp_set_auth_cookie(
   $user_id); do_action(‘wp_login’, $loginusername);
 * Thanks,
    Robert

The topic ‘Programmatically login’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [WORX Developer](https://wordpress.org/support/users/developeratworx/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/programmatically-login/)
 * Status: not resolved