• Resolved chrismah

    (@chrismah)


    I’m attempting to use Redirection to send user back to the referring page after login/logout. I’m sure there’s a simple way to do this, but can’t seem to figure it out.

    Can someone assist? Feel free to send on a pointer to documentation. I may have missed this specific section.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Godley

    (@johnny5)

    The typical way is to pass the previous URL as a parameter, and then you can redirect based on that.

    Thread Starter chrismah

    (@chrismah)

    Thanks, John. I understand conceptually what I need to do. I’m looking for instructions on how to do it, if possible.

    Scenario:
    1. Bill is on the page https://www.helpmeout.com/post-1
    2. Bill clicks “Log-In.”
    3. Bill logs in with FB credentials using wp-login.
    4. Bill is logged in and taken back to post-1.

    How do I pass the current url in step 2, and then how do I set that dynamic value in Redirection in step 4?

    Plugin Author John Godley

    (@johnny5)

    I think you should be looking more at your login system than Redirection. The WordPress login system already handles redirecting back to the original URL. You mention wp-login, and so you should use the facilities it provides.

    You should be very careful about redirecting based on user input as you could create an open redirect, which would allow people to abuse your site.

    https://dzone.com/articles/what-is-an-open-redirection-vulnerability-and-how

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirection to referrer after login/logout’ is closed to new replies.