When I want to redirect a user to a specific page behind a login wall and they're not already logged in, they get redirected to the homepage where they can login. When they login, they are redirected to a default address.
How do I go about remembering where the users original destination, before they were redirected to the login page?
EDITED WITH SOLUTION
Thanks for the responses. What I've done is set a GET request when the user is detected to not have logged in, using the URL: domain.com/?url=$_SERVER["REQUEST_URI"]
So when the user is redirected to the login page, the address that the user tried to get to is set in the GET value. When the user logs in and authenticates, I do a test to see if there's a GET value, if there is, then append it to the end of the URL address bar.
END EDIT