in my website when a user click on a link that require permission (guest users cant see that page), user redirect to login page. & after login user goes to index page again, but i want user redirect to page that user clicked on it.
i have an include file on every page (chkpermission.inc) that checks user logged in or not, & if not redirect to login.asp .
in addition, i wonder why request.ServerVariables("HTTP_REFERER") doesnt work right in this case.
for example i have this inc file on page2.asp. when user click on this page link from index.asp guest user first go to page2.asp & after that redirect to login.asp. but request.ServerVariables("HTTP_REFERER") return "index.asp".
Last edited by bono56; 03-05-05 at 03:30.
Hmmm,.. that's a bit weird... I do know that not all browsers will support http referer and some firewalls block that information, but in that case I wouldn't have even expected you to get index.asp so.....
Not an ideal solution but what about using a session variable. At the start of the page you can set the session variable to the page name, something like:
Session("sPage") = "index.asp"
Then when your code sees that the user is not logged in and redirects them to the login page you can direct them back to the page that is staored in the session variable. I know this is not ideal, but just a thought for now perhaps??