disable/remove redirect to the last page
3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: September 17, 2015 (RSS)
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
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
PHP Programmer - interactivetools.com