All Forums >> [Scripting] >> ASP >> ASP login area question Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I have created a website and the homepage is accessible to anyone. But as soon as the user wants to go to any other page, they are prompted to login. If the log in is successful, they are taken back to the homepage and from there the user can access any page on my site. What can I do to take the user to the page that they originally intended to go to after logging(whatever page that may be) instead of first being taken back to the home, because I'm thinking that after people log in and see the home page, they may think that something isn't working right, because they have to click twice to get to the page.
I downloaded my code from the Net and just modified it, so if you need me to post my code, I will gladly do so. Thanks in advance for your prompt responses.
Hi, I used the following code to try and redirect the person to their intended destination after they logged in but I failed<% = Request.ServerVariables("HTTP_REFERER") %> If I place this code on the login page, the value it picks up is the homepage and if i put it in my verify.asp page, it picks up the login page. But it wouldn't pick up my intended destination. The code in my protected files are as follows: <% 'Check if user is logged in if Session("name") = "" then 'If not, go to login page Response.Redirect("login.asp") else 'If, build page Response.Write("<title>ASP Page</title>") Response.write("<center>Welcome " & Session("name") & "<br><a href=logout.asp>Logout</a></center>") end if %> Any help would be appreciated.
Thanks for your response. Unfortunately this doesn't exactly answer my issue. In this example, you are redirected to one specific page. I need help redirecting the user to the page page he intended to go to when he was asked to log in.
A friend suggested I try the following: "dump the link to the page the user wanted to go to in a session variable...then in your login page, check if there's a value in this variable and direct to it, else go to normal home page."
Is this a good method and do you perhaps have an example of how this can be accomplished. Thanks