• Hi there,

    Has there been any reports on wp-members creating 2 session instance at a time when a user logs in each time?

    I was reported of an issue regarding concurrent login limit not working properly when using Inactive Logout(plugin). So, i took a deeper look and found that wp-member is creating 2 session instance per login.

    To verify this further – i installed another plugin as well called “Sessions(plugin)” and found same issue there as well. (*Deactivated any other plugins that might have sign-in hook calls)

    Shortcode i used: [wpmem_form login]

    So, taking a deeper look again; into the code now. Found that there was a function after user signon trigger. Not sure what this does but this seems to be the culprit.

    // Make sure current user is set.
    wpmem_set_as_logged_in( $user->ID );

    When above code is active 2 sessions are registered if a user signs in. So, just wanted to know if this an issue from wp-members?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    Based on what you’ve outlined here, and a quick review, it does seem that it is likely to be an issue. I will have to look into it further and determine whether that can just come out altogether, or what, if anything, will be the final outcome, though.

    Thanks for noting this.

    I am also having the same problem. It throws an error when I use the login limit function. Each login Wp-member will create 2 login sessions.

    This is the response of the Inactive logout plugin author when I reported the login error to them.
    “I think I found the issue. You are using wp-members plugin most probably for login popup? correct? So, i installed that plugin into my local and checked if this was acting strange and yes, this plugin is causing issues here.  WP -Members is creating 2 instances of login when a user logs in because of which inactive logout fails to identify the login limits.Each time a user logs in 2 sessions are counted.

    • This reply was modified 1 year, 7 months ago by badamgiak23.

    I had the same problem when using anti-login concurrently on 2 locations because wp-member login created 2 login sessions in each login. I tried with the default wordpress login form, each login only creates exactly 1 session. This causes concurrent anti-login plugins to not count correctly and causes login errors. I just switched to using Memberpress as a membership management plugin on my website and everything is working correctly again.

    Community Verified icon
    Plugin Author Chad Butler

    (@cbutlerjr)

    Thanks again for reporting this.

    Looking through the development history, I not 100% why the user was being set as logged in separately from wp_signon() as that function should be setting the user. I believe there was a legacy issue some time ago and adding the setting of the user was added then to resolve it (but I’m not 100% certain as this appears to have been quite some time ago).

    As wp_signon() ultimately should succeed with setting the user auth, the line you originally noted is unnecessary. So, the likely resolution will be to remove that in the next release pending the outcome of testing (but I think that will end up confirming the removal).

    So to resovle in the meantime, you could go to wp-members/includes/class-wp-members-user.php and remove line 104:

    wpmem_set_as_logged_in( $user->ID );

    Alternatively, I have provided a patched version of the file with this change at the following gist:

    Resolve issue of two user sessions (github.com)

    To use it, simply replace the wp-members/includes/class-wp-members-user.php file with that.

    Ultimately, this change will be included in the next update.

    Thanks again for reporting it.

    Thanks for your support. The problem has been resolved. Great !!!

    Plugin Author Chad Butler

    (@cbutlerjr)

    Thanks for letting me know that change resolved it. I expect that change to be incorporated permanently in the next release.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Creating Multiple same sessions on Login’ is closed to new replies.