Simple Membership Plugin › Forums › Simple Membership Plugin › Automatically logging in
Tagged: login
- This topic has 7 replies, 3 voices, and was last updated 8 years, 3 months ago by
mbrsolution.
-
AuthorPosts
-
January 26, 2018 at 8:32 am #13129
vandenbusken
ParticipantI’m automatically logging in users visiting from certain IP ranges. For some reason this doesn’t seem to be working in conjunction with Simple Membership. Users are logged in to WordPress but when trying to view protected content they still have to login.
I’m using the following functions to login:
wp_set_current_user($user_id, $loginusername);
wp_set_auth_cookie($user_id);
do_action(‘wp_login’, $loginusername);Anyone know why this isn’t working?
January 27, 2018 at 5:41 am #13139mbrsolution
ModeratorHi, are you also importing your WP Users into Simple Membership members area?
January 29, 2018 at 12:48 pm #13158vandenbusken
ParticipantI’ve created a new WP user. When creating a new user it automatically adds it to Simple Memberships members and vice versa. I’ve activated this new user.
I still have to login to view protected content. I don’t know why because the auto login function is being executed when visiting the site.January 29, 2018 at 10:07 pm #13160mbrsolution
ModeratorHi, the way the plugin works is like this.
If you add a WP user and you want this user to also be added to Simple Membership plugin you need to import the user into Simple Membership plugin. This works very well and without any issues. This is the best way to achieve what you are trying to achieve.
Kind regards
January 30, 2018 at 4:04 pm #13169vandenbusken
ParticipantThank you for your reply.
I’m not seeing an import option but I don’t believe that is necessary. The user account I’m testing this out with is listed on the members overview page in the Simple Membership plugin. I can manually login and view protected content. The only thing that doesn’t work is automatically logging in using the functions I mentioned previously.
January 30, 2018 at 10:01 pm #13170mbrsolution
ModeratorHi, unfortunately I am not a developer. However looking at your function, I don’t see any reference to Simple Membership plugin. Have a look at the following tweaks. They might help you with your function.
Kind regards
February 20, 2018 at 7:00 am #13429vinaysamant
ParticipantIs there a way i can add every new WP user to SMP automatically as soon as they register?
February 21, 2018 at 7:06 am #13446mbrsolution
ModeratorHi @vinaysamant, can you start a new support thread please. It allows us to better manage each question.
Thank you
-
AuthorPosts
- You must be logged in to reply to this topic.