[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Knowing which page the user come from for logging them back in ASP

Hi All

I want to change the login process on my application so that after the user is redirected back to the login page when thier username expires that they can be redirected back to the page they were on. My login is done through login.asp

The page that are normally on is called recorddetails.asp which has an include file called sessioncheck.asp which has the following code

yourPage = request.ServerVariables("http_referer")
strUsername = session("Username")
if strUsername = ""  or strUsername = NULL then
               Response.redirect "login.asp?ReturnUrl=" & yourpage
End if

Now if it was a simple page like recorddetails.asp then it is not a problem but I am also passing the id of the record through the querystring.

so my recorddetails.asp page is the url looks like recorddetails.asp?Id=2665

is there anything I can do pick the whole url rather than just the name of the page.

Thanks in advance for any help
I can use the
1 Solution
Simply use this :

yourPage = request.ServerVariables("http_referer") & request.QueryString

Request.QueryString will return anything that pushed into your url after ? symbol

hopfully assist you

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now