• Resolved CharlyLeetham

    (@charlyleetham)


    I restrict access to content based on the WP User Role. With Membershipworks Login Connector active, members cannot see this content.

    Looking at wp-content/plugins/memberfindme-login-connector/memberfindmelogin.php
    I note lines 90 and 91:

    wp_clear_auth_cookie();
    wp_set_current_user(0);

    The current user ID should not be set to 0, it messes with the WP User system.

    I have commented these two lines out and the system now works as expected.

    Can this be rectified, please.

Viewing 1 replies (of 1 total)
  • Plugin Author MembershipWorks

    (@sourcefound)

    Hello,

    Calling wp_set_current_user(0) is part of the standard WordPress logout process – please see the source code for the wp_logout() function:

    https://developer.www.ads-software.com/reference/functions/wp_logout/

    Note that we do not call wp_logout() in order to avoid the do_action(‘wp_logout’,$user_id) which normally causes a (undesirable) page redirect.

    It does appear that we did not call wp_destroy_current_session() which was introduced more recently, this will be added to the plugin in the next release.

Viewing 1 replies (of 1 total)
  • The topic ‘Member ID changed on login’ is closed to new replies.