W
William
I'm new to ASPX. In my .aspx page I set multiple cookies from the session
variables to the "visitor" container:
dim cookie as HttpCookie
cookie=new HttpCookie("visitor")
cookie.Values.Add("cid", Session("sid"))
cookie.Values.Add("ckeywords",Session("skeywords"))
cookie.Values.Add("ccampaignno",Session("scampaignno"))
cookie.Values.Add("cadgroup",Session("sadgroup"))
cookie.Expires = Now.AddDays(365)
response.appendcookie(cookie)
But I need to set those cookies only if they do not exist on the computer.
If I surround the code with if-then statement that looks like this:
If Request.Cookies("visitor") is Nothing Then
dim cookie ....
...
...
response.append ...
end if
the browser gives me an error.
My question is how do I check if the container "visitor" exists in cookies?
Thank you for your time.
variables to the "visitor" container:
dim cookie as HttpCookie
cookie=new HttpCookie("visitor")
cookie.Values.Add("cid", Session("sid"))
cookie.Values.Add("ckeywords",Session("skeywords"))
cookie.Values.Add("ccampaignno",Session("scampaignno"))
cookie.Values.Add("cadgroup",Session("sadgroup"))
cookie.Expires = Now.AddDays(365)
response.appendcookie(cookie)
But I need to set those cookies only if they do not exist on the computer.
If I surround the code with if-then statement that looks like this:
If Request.Cookies("visitor") is Nothing Then
dim cookie ....
...
...
response.append ...
end if
the browser gives me an error.
My question is how do I check if the container "visitor" exists in cookies?
Thank you for your time.