Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004

    Unanswered: redirect from login page

    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 ( 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. Reason: edit

  2. #2
    Join Date
    Nov 2003
    Christchurch, New Zealand
    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.....

  3. #3
    Join Date
    Nov 2004
    Provided Answers: 1
    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??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts