Re: Membership logoff page
I am using the Website Membership plugin and I have set my logoff URL to be google.com:
$GLOBALS['WEBSITE_LOGIN_POST_LOGOFF_URL'] = PREFIX_URL.'https://www.google.com';
When I click a logoff text link the page just refreshes and it seems I am not logged out.
This is the link code I am using:
<a href="?action=logoff">Sign out</a>
Could someone please advise me?
There are a few things to comment on here.
First, it looks like there's an issue in the plugin where it will essentially never use the WEBSITE_LOGIN_POST_LOGOFF_URL value. If you want to use the post-logoff URL, find the following line in websiteMembership.php (line 189 in version 1.13):
$logoffUrl = coalesce(@$_SERVER['HTTP_REFERER'], $GLOBALS['WEBSITE_LOGIN_POST_LOGOFF_URL'], $currentPageUrl, '/');
And change it to this:
$logoffUrl = coalesce($GLOBALS['WEBSITE_LOGIN_POST_LOGOFF_URL'], @$_SERVER['HTTP_REFERER'], $currentPageUrl, '/');
Second, you can remove "PREFIX_URL" from the Google URL so that it looks like this:
$GLOBALS['WEBSITE_LOGIN_POST_LOGOFF_URL'] = 'https://www.google.com';
In most cases, PREFIX_URL will be empty and not cause any issues, but there are some situations where it could be a problem.
Unfortunately, I can't think of a reason why the above issues would prevent you from logging out; the link you're using should work regardless. My recommendation at this point would be to try making the above changes to see if there's any effect, in case they're having some unexpected effect. If not, let me know and I can try to think of some further troubleshooting steps.