Role not recognized after log in

We are running the latest version of s2Member Pro. It has been running fine for a while on our site

Recently we decided to upgrade our theme, to move away from Headway. Our ISP created a Development instance where we did all the upgrade work and testing. Everything worked fine in that environment.

We decided to move the upgraded version into production. That’s when we started to experience some odd behaviour.

We can log in to our s2Member accounts and the system recognizes that the member has the s2Member-Level1 role when you check their profile.

However, when they try to access any page that is restricted to Level 1 or higher, the system does not recognize the role.

Can anyone shed some light on where the disconnect might be? Is it cookies related? Sometimes Chrome complains that cookies need to be enabled when logging in, even though cookies are already enabled. Clicking the login button a second time gets you in…

Hate to have to resort to a backup of the site prior to the theme upgrade. We will lose 2 days of work… HELP!

What EXACTLY happens when such a member attempts to access such a page?

It redirects them to our default page for “prospective new members” indicating that the content they were trying to access, is only available to members (Level 1 or higher).

Have you set MOP Vars to show in the URL? If so, you should be able to see if level 1 is the only restriction set, or if you have another restriction working there.

Do I just use the [/s2MOP] shortcode on the Membership Options page? Have not used that shortcode before…

No. See General Options -> MOPage -> Enable MOP Vars. Set to Yes and save.

It is already enabled. That is why users are being redirected to the Membership Options Page, when they try to access a page that has the restriction “Requires Level 1 or Higher”.

But the users that are being redirected are at Level 1.

No. The MOP Vars don’t cause the redirection. That happens as soon as the MOP is set up. The MOP Vars expose variables that enable you to read things about and do special things with the redirection.

So if you go to a page at level 1 and then get redirected, you will see a very long URL. Post that here. You can omit the domain name if you want; it’s not what I need to see.

Got it… sorry for being slow on the uptake. I have not had much familiarity with this function of s2Member.

Here is the URL once re-directed: https://…/membership/?_s2member_vars=page…level…1…page…11826…L3NpZ3Mv&_s2member_sig=1497556521-bbf47bf8f05dcabedfee7e4cb8c0f675

I can see the Level 1 restriction, but I have no clue what all the other STUFF is hanging off the end of the URL.

That’s saying that the user was redirected from page ID 11826 and then it’s coded various other stuff that’s not relevant here. So that all looks normal.

So I’d check that the user really does have the right role (always check the obvious first!) and, if so, then I’d think about how you migrated the site. Have the domains been changed appropriately? Are you running some caching, like Varnish?

The user definitely has the Level 1 role assigned… but thanks for the reminder, that was the first thing I checked.

I suspect that the migration of the site by our ISP is the culprit.

They originally created a DEV instance by adding a new folder in the files system as follows: /home/mysite/dev.mysite.ca that replicated what was under /home/mysite/public_html.

When we were done they just moved everything back to /home/mysite/public_html.

Not sure if that clobbered something in the process.

We use W3 Total Cache and all caches have been purged several times.

How did you set up the restricted Pages/Posts? Did you use the metaboxes on the Post/Page Edit page or something else? If you used Categories/Tags/URI restrictions this is probably domain-related.

I just use the metaboxes on the page edit panel as shown below:

Roger

Not wanting to assume anything have you checked that the restrictions are still set to Level 1. If I were to assume, I’d assume the answer was “yes” but needed to ask anyway.

Does the domain portion of the URLs being displayed on your site look right? No extra directories after or sub-domains before the domain?

No everything looks normal.

I also posted a support question on s2Member Pro support and they indicated
that we should have exported the membership data and re-imported it into
DEV and then once we ported the DEV site to PROD, to re-import the
membership data.

So basically I decided to start with a clean backup copy and go through the
whole process again.

Thanks for the suggestions! Have a super day!

Roger

Well, I hope that works, but I’ve migrated at least 20 s2Member sites without exporting the s2Member data and then importing it on the other end without losing any of the changes s2Member made in the database. No offense to WebSharks support. I’m glad to hear that they have reinstated a support desk too.