latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Redirect on logout

Home Forums Community Forum Redirect on logout

Tagged: ,

This topic contains 4 replies, has 4 voices. Last updated by  Raam Dev 4 years, 8 months ago.

Topic Author Topic
Posted: Thursday Apr 12th, 2012 at 2:49 pm #10684

Hi
I am trying to control the redirect behavior of the logout link.

I have a line in functions.php that adds logout the the membership menu. It sets the logout redirect to home.

No matter what I do, the system redirects to the membership options page on logout.

This URL query string seems to append to the home page link despite anything I do.

Is there a way to stop S2Member from attaching what looks like a MOP Variable query string on logout?

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Friday Apr 13th, 2012 at 7:13 am #10719

Joanne,

What is the code in your functions.php file? Have you tried clearing the browser cache.

I have seen other plugins and themes interfere with login/out redirection, have you tried disabling plugins and or switching to the default theme to see what happens.

Posted: Friday Apr 13th, 2012 at 11:46 am #10739
Raam Dev
Username: Raam
Staff Member

Hi Joanne,

Showing us the code from functions.php that you’re referring to would be very helpful. Also, if you could copy/paste the URL that you’re being redirected to when logging out (the one with all the MOP variables; please show us the full URL), that would also be helpful.

The only reason s2Member should redirect you to the Membership Options Page after logout is if the page you’re being redirected to is protected by s2Member (i.e., the now-logged-out user doesn’t have access to the page).

Posted: Friday Apr 13th, 2012 at 6:21 pm #10767
Roger Rueff
Username: scene13

I have the same question, slightly different implementation.
I put a “Logout” link in the header of my site and linked it as follows:

<a href="<?php echo S2MEMBER_LOGOUT_PAGE_URL; ?>">Logout</a>

By default, the logout redirects to the generic login page (the customizable one that comes with the s2Member logo). I want to redirect to a logout page on the site… or to the home page, as the s2member Pro Login widget does.

How can I specify the URL for S2MEMBER_LOGOUT_PAGE_URL?

Thanks in advance.

————————————————————-

Never mind. I found the answer in another topic (/forums/topic/logout-redirect/)… using the WP logout code:

<a href="<?php echo wp_logout_url('http://yoursite.com/goodbyepage'); ?>" title="Logout">Logout</a>

Works perfectly for what I need.

  • This reply was modified 4 years, 8 months ago by  Roger Rueff.
Posted: Monday Apr 16th, 2012 at 5:04 pm #10923
Raam Dev
Username: Raam
Staff Member

Hi Roger,

Thank you for posting the solution! You can also use the following:

<a href="<?php echo S2MEMBER_LOGOUT_PAGE_URL; ?>&redirect_to=%2Fgoodbyepage%2F">Logout</a>

That would redirect you to a page called /goodbyepage/ on your site upon logout.

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.