Link to home
Start Free TrialLog in
Avatar of lherrou
lherrouFlag for Ukraine

asked on

ASP referer - session variable?

I designed a website for a client, and on every page there's a form that allows the site visitor to request more information. As well as the information they enter on the form, I create a hidden variable to get the referer, like this:

<input type="hidden" name="referer" value="<%Response.Write(Request.ServerVariables("HTTP_REFERER"))%>">

When they have completed the form, and click send, an email is generated, and indeed contains the referer. The problem is that if they complete the form from the first page they arrive at (the home page, say), then the referer is the site they arrived from. However, if they wander around on the site and then complete the form, the referer is the page within the site that they last visited - so if they go from Google to the home page to the clearance page (a common path), a form filled out on the home page will show that they arrived from Google, but a form filled out on the clearance page will show they arrived from the home page.

I'd like to find a way to store the referer as a session variable or something, without using cookies, so that they can enter on any page, go from page to page, and whatever page they happen to be on when they complete the form, it still knows what the original referer was...

Any thoughts on how to handle this? Thanks.
LHerrou

(btw, keep KISS principle in mind when answering, I am not a ASP programmer, I just tinker with it from time to time).

ASKER CERTIFIED SOLUTION
Avatar of nschafer
nschafer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lherrou

ASKER

Neal,

Perfect, thanks.

I already produce each page with includes for the top and bottom of the page, so it was easy to add once and apply across the site.

LHerrou
Avatar of lherrou

ASKER

Neal,

Also review http:Q_21658105.html

LHerrou
Always glad to help and thanks for the recognition.

Neal.