Click to See Complete Forum and Search --> : session query string


adman22
05-22-2009, 01:27 PM
Situation: I have ad units on other sites and when the user comes to my site I want to capture the string on the first page visit per session.

Goal: Capture initial visits page querystring and hopefully visitor fills out my form and then I would capture the querystring.

Problem: I am able to capture a query string from a single page and retrieve it later on another page during the session. I need to expand this idea so I can capture a query string from any page on my site and not just one single isolated page. So, my thinkings would be that I need to create a test upon capturing the querystring for the first time, and if the user goes to another page that either has a string or not that it doesnt over ride the the first captured querystring. Any ideas on how to do this, as I am stumped.

yamaharuss
05-23-2009, 09:09 AM
Include a file at the top of every page and in that file:

'begin include file
If session("myquerystring") = "" then
strValue = request.querystring("querystringvalue")
session("myquerystring") = strValue
Else
strValue = session("myquerystring")
End If
'and if you want to set a default if nothing exists
If strValue = "" then
strValue = "MyDefaultValue"
End If
'end include file