Page 1 of 1

"Do You really want to logout?" page

PostPosted: May 28th, 2010, 12:23 pm
by mandyfeinstein
Hi!
Everything works great so far, i was just wondering if there was someway to bypass the "Do You Really Want To Log Out?" page. I would like it to just log out and return to the page the user was on or even the home page. Thanks so much!

Re: "Do You really want to logout?" page

PostPosted: June 23rd, 2010, 10:21 pm
by Jason Caldwell
Hi Mandy, this happens internally with WordPress. That screen is not triggered by s2Member, but by the WordPress core framework. The reason it happens is this.

If you supply a logout link, like this:
This will trigger that screen, because it does NOT include the "_wpnonce" key which verifies logout.
Code: Select all
http://mysite.com/wp-login.php?action=logout


The solution is to generate your logout link, like this:
<?php echo wp_logout_url(); ?>, which will produce something like this:
Code: Select all
http://mysite.com/wp-login.php?action=logout&_wpnonce=9b6fc1ed37