• Resolved Mxlaxe

    (@mxlaxe)


    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

    (@mbrsolution)

    Hi, do you have a cache plugin installed in your site? Does your server run a cache system?

    Thank you

    Thread Starter Mxlaxe

    (@mxlaxe)

    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

    (@mbrsolution)

    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

    (@mxlaxe)

    Any help on this particular problem would be highly appreciated.
    Let me know if you could identify the issue.
    Thanks

    Thread Starter Mxlaxe

    (@mxlaxe)

    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

    (@mbrsolution)

    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.