I have pages which require the user to be logged in and have a session_id to view them. I want to make it so that if a user tries to visit that page but isnt authenticated yet, then they are sent to a page where they can login. Once they login they are redirected back to the page they wanted to view.
I can make it so they are redirected back to that page, but the variables are not kept intact (eg if they wanted to view products.php?pid=12 it only redirects back to products.php). How can I pass the variables to my login script? (or get a list of the variables that are set at any point in time?)
Thanks,
Jamie