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 Mikey - 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 Mikey - 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

By ross - March 1, 2017

Hi Zicky

Thanks for the update. Glad you found Greg's post.

Let me know any other questions that come up :)

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/