We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27716
    • 126 Posts
    Hi Guys.

    Sometimes I create a link to a login page. Im wanting to know if it is possible to create a link that returns the user the the same page they were on when they click login.

    Any tips appreciated.

    Stuart
      • 25308
      • 46 Posts
      Quote from: smcilreavy at Mar 30, 2011, 05:17 AM

      Hi Guys.

      Sometimes I create a link to a login page. Im wanting to know if it is possible to create a link that returns the user the the same page they were on when they click login.

      Any tips appreciated.

      Stuart

      Hi, Are you using Revolution? If so you can use the login package. Just add the "&loginResourceId=``" field to your login call and set the destination to the page of your choice. If you choose "`0`" then the login will redirect to itself.

      Example:
      [[!Login? &loginResourceId=`13`]]


      does that answer your question? grin
        • 38846
        • 30 Posts
        I don't think this is what he is asking. I am searching for the same thing.

        When a users is on a page and clicks login and is redirected to login page. Then they login. Once they login Iwould like it to redirect back to the page they were on before they clicked login.

        ie...I am on page 2 I click login, redirect to login... I login then am redirected back to page 2.
          • 38846
          • 30 Posts
          answer is :
          &redirectToPrior=`1`
          but I have found as you can see from my conversation with Bob about this that:

          1. It doesn't work properly in some browsers and is not working at all on my localhost.
          2. is a security risk because it is using
          $_SERVER['http_referer'];
          . Which is subject to hijacking.

          There is no real good solution for this other than offering links back to the page they were on or making the login a popup. Which is a whole bag of messiness that I wish not to involve myself with.