Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

eMember – programmatically login user

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Troubleshooting › eMember – programmatically login user

  • This topic has 1 reply, 2 voices, and was last updated 6 years, 2 months ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 31, 2019 at 8:29 am #15374
    vinay samant
    Member

    i need to programmatically login user so that i can use : Emember_Auth::getInstance()

    i m using following code to login user to wordpress

    $user=get_user_by(‘id’, $request);

    clean_user_cache($request);

    wp_clear_auth_cookie();

    wp_set_current_user($request);

    wp_set_auth_cookie($request, true, false);

    update_user_caches($user);

    This manages to login user, but doesn’t allow me access Emember_Auth::getInstance()

    This is required for JSON feed for my mobile application.

    April 2, 2019 at 3:49 am #79417
    admin
    Keymaster

    That class can only be accessed after the “plugins_loaded” or “init” hook as been triggered by WordPress. If you try to access it too early in the page load execution cycle, it won’t work since WordPress hasn’t loaded the plugins yet.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ