I have a Login page which serves the login functionality as well as a link to Register. On this page I get the previous page URL using
document.referrer
This helps to take the user back to the original page once login is successfull.
Now, there is a Register option on the same login page which takes to the Registration page. In a typical scenario when the user comes from some page, Page1, to the login page, Page2, and from there goes to Registration page, Page3, how do I keep track of Page1 so that on successfull registration the user is sent back to Page1 from Page3.
document.referrer
will return Page2 and will take back to the login page on successfull registration.
Any clues.