disable/remove redirect to the last page

By ht1080z - September 16, 2015

Hi,

I want to disable/remove the websiteMemebership add-on feature that redirect users (from different pages) to the last used after logon.

In the main plugin php file which is the setting that override the redirection to the last page?

// After logoff, user gets redirected to the last page they were on (if defined), the url below, or to /
$GLOBALS['WEBSITE_LOGIN_POST_LOGOFF_URL'] = '/';

Also, i need to find in my page sources for other script that enable this redirection?

Thank you in advance,
Karls

By gregThomas - September 17, 2015

Hey Karls,

You can do this by removing this code from your login page:

  // save url of referring page so we can redirect user there after login
  if (!getPrefixedCookie('lastUrl')) { setPrefixedCookie('lastUrl', @$_SERVER['HTTP_REFERER'] ); }

So this cookie variable will store the last page the user came from, and when they login it will be used to redirect to that page. By removing this, the user will be redirected to the default post login URL set in the website membership plugin:

// After login, user gets redirected to the last page they were on (if defined), the url below, or to /
$GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL']  = '/';

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By ht1080z - September 17, 2015

Hi Greg,

Thank you for the clarification!

Karls