Title: Login sync issue
Last modified: July 16, 2020

---

# Login sync issue

 *  Resolved [Mxlaxe](https://wordpress.org/support/users/mxlaxe/)
 * (@mxlaxe)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/)
 * Hi,
 * I have checked the Force WP User synchronization in the settings and my problem
   is as follow:
 * At some point I need to login using php and the WordPress function wp_signon.
 * However, after I’m logged in for WordPress, the page reloads, but then it turns
   out I am not logged in for the SWPM plugin which is not the expected behaviour.
 * How can I have my SWPM user to login when using the wp_signon function ? IS there
   a simple way to log in through php or something ?
 * Thanks!

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

 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/#post-13133505)
 * Hi, do you have a cache plugin installed in your site? Does your server run a
   cache system?
 * Thank you
 *  Thread Starter [Mxlaxe](https://wordpress.org/support/users/mxlaxe/)
 * (@mxlaxe)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/#post-13133938)
 * No there is none installed.
 * The call to wp_signon() is made like this: through an ajax call first, then the
   php function runs the wp_signon(), and finally the page is reloaded on success.
 * I am just wondering how does the sync process work. Does it hook into the core
   login function ? Why isn’t the sync working in this scenario ?
 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/#post-13137742)
 * Thank you for sharing more information. I have submitted a message to the developers
   to investigate further your issue/questions.
 * Kind regards
 *  Thread Starter [Mxlaxe](https://wordpress.org/support/users/mxlaxe/)
 * (@mxlaxe)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/#post-13139207)
 * Any help on this particular problem would be highly appreciated.
    Let me know
   if you could identify the issue. Thanks
 *  Thread Starter [Mxlaxe](https://wordpress.org/support/users/mxlaxe/)
 * (@mxlaxe)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/#post-13144149)
 * Replying to myself: I somehow managed to find a way to make this work.
 * After logging in with the wp_signon() function, I called the following hook like
   so:
 *     ```
       $myuser = null;
       if ( class_exists('\\SimpleWpMembership')){
          $myuser = do_action( 'swpm_login', $user, $pwd, true);
       }
       ```
   
 * Then when I try to go to the profile page, I can access it without being asked
   to login like before.
 * However, the plugin’s API is not very clear to understand and the separate user
   management from the WP built-in user system adds a layer of complexity.
 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/#post-13148465)
 * Hi, I am happy to know that you managed to solve your issue. Well done. Also 
   thank you for sharing your solution. I am sure this will help others.
 * Kind regards

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

The topic ‘Login sync issue’ is closed to new replies.

 * ![](https://ps.w.org/simple-membership/assets/icon-128x128.png?rev=974529)
 * [Simple Membership](https://wordpress.org/plugins/simple-membership/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-membership/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-membership/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-membership/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-membership/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-membership/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/login-sync-issue/#post-13148465)
 * Status: resolved