Re-direction after logged in

Hello, i have an issue with logged in users. i explain my setup and then what causes the issue.

Setup: in the MOP there are 3 different links, each one for 3 different type of users. This 3 links point to the standard wordpress login form, after they are logged in each user sees the content appropriate to their membership, all this is working fine.

Problem: when users, say “user type A” for this description, logs in… he has 10 pages available in his plan, so he goes to page 1, all good. But, when he wants to go to page 2 the natural behaviour is to click links on the MOP links again, witch points to the login from wordpress, and they are not redirected to the login welcome page, but rather they need to log in again…¿can this be avoided so they are redirected to the login welcome page without having to log in every time? thanks

You should probably use a conditional that checks whether they’re logged in, and redirect them accordingly…

How are you doing the redirection, with javascript in the Membership Options Page? You could use an s2If to check the login status. https://s2member.com/kb-article/s2if-simple-shortcode-conditionals/

Hello Cristián, sorry for the inconvenience. I guess what i don´t understand is how to redirect logged in users to the LIW page when they click in the links of the MOP page, when they are all ready logged in.

Since i have the links in the MOP page directing to the wordpress form:
https://www.escuelacosmetologiabf.cl/wp-login.php?
How can i achieve that, if they have all ready logged in once, and if they click again on this same MOP links, that they don´t have to actually log in again, but get redirected instead to the LIW page…

It seems basic, but i don´t get it, ¿ is it correct to be placing in the MOP page the wordpress form link as the links to acces de LIW page? ¿or shoud i place the links to the LIW page in the MOP page links instead?

Or even, since i have a page in my website called “Intranet” that is set as the MOP page, ¿should i put in the link to go to the lntranet page the link to go to the LIW page instead ?

As for now, i have succesfully placed this code in the LIW page to show different content to them:
[s2If current_user_can(access_s2member_ccap_example)]
content for example ccap
[/s2If]

As for a possible solution, please tell me if it is the right way for achieving what i need, would be placing this in the LIW page instead be what i need?:

[s2If is_user_logged_in() AND current_user_can(access_s2member_ccap_example)]

[/s2If]

thanks

FYI: really sorry to add another different and new issue here, it just came up, the most weird thing, when i de-activate the w3 total cache plug in S2 stops giving acces to protected pages, it still allows to log in and shows correctly the LIW content, but when trying to access the next protected content it sends back to the MOP page…!!! so annoying ¿any idea what can cause this or how to fix it?
thanks again

Could you describe what these links are?

The Membership Options Page is where people get taken if they try to access protected content that they don’t have access to. The Login Welcome Page is protected with Level 0, i.e. user has to be logged in, or they’ll be sent to the Membership Options Page.

Where you link to the wp-login form, you can simply tell the person: if you’re not logged in, please click here to login. You can also just show that to the user if he’s not logged in (using the s2If, is_user_not_logged_in() for example).

As for a possible solution, please tell me if it is the right way for achieving what i need, would be placing this in the LIW page instead be what i need?:

User is already logged in if he can see the LIW, since it requires Level 0. current_user_can(…) is fine there, of course, so you can customize what you show him.

:slight_smile:

is kind of difficult to communicate this way…can you help me please if i send you user credentials so you can better help me solve the issues? maybe talk on whatsapp or something?

Sure, you can send me credentials, I’ll message you in a sec. I’d still need to understand well what you are trying to achieve.

:slight_smile:

i sent you the info, do you see it?

Hello Cristián, i need your help please, i deleted w3 total cache and now S2 won´t allow logged in users to access protected content. Every configuration seems fine, but when trying to access protected pages logged in users are redirected to the MOP page.

I´ve disabled all cache, deleted the w3 folders from cpanel, etc, the issue persists. With W3 installed is the “page cache” feature that causes the issue, if i disable this feature S2 stops granting access to custom capabilities protected pages.

i need to solve this very urgently, please. Thanks.

Hello Cristián? is anybody out there?

i understand is not a good idea to mix 2 different issues in one topic, so i posted a new topic for this second issue, that´s more urgent, and quite problematic. The first issue that i posted in this topic i have resolved momenteraly by adding navigational buttons within my setup.

Hi Paul.

Sorry, been preparing a new release and was a bit tied up with many things.

I saw the message you sent with the login, tried it but didn’t work, I guess you updated the password since then.

I’ll check out the other thread you started.

:slight_smile: