Website membership do not redirect on login and stay on page

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 1, 2017   (RSS)

By Zicky - February 28, 2017 - edited: February 28, 2017

I need to set one page that has a website membership login to stay on the same page once the user has logged in. However I do not want to change the "Website membership" plugin redirect settings - as I need it to remain just as it is now.

Anyone have any suggestions on how to add a line of code to the one page and keep them on that same page once they have logged in?

Thanks, Zicky

By Zicky - February 28, 2017 - edited: February 28, 2017

I think I got this figured out searching the forum, and using Greg's tip:

In response to: [url "http://www.interactivetools.com/forum/forum-posts.php?postNum=2237388#post2237388"]disable/remove redirect to the last page[/url], ...

I added this line to my webpage:

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

Now I stay on the same page once I login.

Zicky