Authorized users not able to login restricted content

I have been using S2 member pro on my website - enggcyclopedia.com for around 9 years. It has worked very well so far.

But yesterday, a registered pro user on my website reported that he is not able to access any premium content (restricted content with S2 member pro). It was working fine previously. But now any user clicking on premium content link gets redirected to the membership sign up page. If I create a new user with premium access, still the same problem persists.

I have not changed anything on the website. Still this problem has come up unexpectedly. Any suggested solutions?

Many thanks in advance :slight_smile:

Hi Pushkar.

When sent to the Membership Options Page, could you please copy the variables s2Member adds to the URL? I’d like to see what the restriction is, and what the access needed by the user is, and please tell me what user level or custom capabilities that person has in his account, so I can get a better idea of what’s happening.

s2Member didn’t change all of a sudden. It’s likelier that something changed in your site’s configuration, or other plugins you have, or the theme you’re using, that suddenly introduced a conflict that wasn’t there before. Or maybe you changed something in s2’s configuration? https://s2member.com/kb-article/common-troubleshooting-tips/

I look forward to your reply. :slight_smile:

Hi Cristian, thannks for your reply.

Here is what we are looking at -

I have marked some pages on my website as restricted using their IDs. The restricted content is accessible for users with level 1 access and above.

I have created 2 premium levels - ‘Silver Member’ (level 1 in S2member) and ‘Gold Member’ (level 2 in S2member).

It was working flawlessly earlier. But if a gold member tries to access any of the restricted pages now, he is redirected to ‘membership registration’ with following URL -
https://enggcyclopedia.com/enggcyclopedia-member-registration/?_s2member_vars=page..level..1..page..7759..L2NhbGN1bGF0b3JzL2luc3RydW1lbnQtc2l6aW5nL3Bzdi1zaXppbmctY2FsY3VsYXRvci1ibG9ja2VkLWdhcy1kaXNjaGFyZ2UtMi8%3D&_s2member_sig=1551759349-ca3cf19711e93e17fd177b5fa9dd4db0

Please note that I have tried to access the above content with level 2 access. Even if I try the same with my admin account, I get the same problem. For some reason S2member is not able to validate that the logged in user has proper role (level1 or above) to access the restricted content.

If I remove the page IDs from restriction settings, this problem goes away. If I put the restriction on any other level (level 0 for example) the problem persits.

I guess the labels for level 1 & 2 (silver member and gold member) are not being correctly identified. This may be caused by some other plugins that have created additional user roles in my WP account.

But if that is the case, how to fix this problem? Your help is appreciated. Please let me know if you need any more info.

Have you just recently installed these “other plugins” or have they been updated recently? Nobody ever wants to hear it, but the easiest way to find out which plugins are causing problems is to test them. Personally, I prefer to start with a clean s2Member install (everything but a default theme and s2Member deactivated) so that I can confirm that s2Member works when used by itself. Once I’ve confirmed that, I turn on the theme I actually want to use. Test again and then start the other plugins one at a time until I find the problem. You can, however, start by deactivating the most recently added/updated plugin or theme and work backwards to the first combination of plugins/theme that works as it should. Once you’ve discovered what plugin or theme is causing the issue, come back here and we might have a better idea of how to work around the problem. It’s very hard to come up with a work around for “some other plugin”.

What I find extremely odd is that you’d be redirected too, being the admin. s2Member never restricts access to an administrator.

What I’m suspecting is session issue. It’s as if you were a visitor instead of being logged in…

Are you by any chance mixing the use of www and none in your links? You need to stick with one and be consistent. See: https://www.s2member.com/forums/topic/dont-mix-www-and-without/

If that doesn’t answer this behavior, then I’d suggest that you follow the common troubleshooting tips I linked to above.

:slight_smile:

Hi Cristian, kudos for an awesome insight !

I was using www prefix in S2member settings and my WP site was not using that prefix. I changed it to ‘www.enggcyclopedia.com’ and the problem is solved for now. It seems to be working fine.

I only wonder why that problem came up now. Because I have used the same configuration for as long as I can remember.

But regardless, my problem is solved for now. Many thanks :slight_smile:

1 Like

Wonderful! I’m so glad that took care of it. Thanks for the update. :smiley:

If you feel like it, it’d help us a lot that you leave a review over at WordPress! https://wordpress.org/support/plugin/s2member/reviews/?filter=5 Thank you! :pray: