Hi Steven,
I am bit confused about cookie again.
Based on the informaiton you provided. I have the following asp code to pass
a cookie id value from domainA to domainB. But it seems that cookie
behaviors in firefox and IE are different and also the cookie value written
by IE cannot be recognized by firefox and vise vursa.
What this code basically does is check the querystring to see if the number
is there, if yes, set the value to the cookie called id, if not, we check the
cookie id on client's machine for this domainA , if it is there,use this
value as cookie id value, if not, assign a default number 12345 to this
cookie id.
function WriteLinkPgm is for creating a dynamic link to domainB with this
cookie id value attached to a specific link.
When I tested in IE, everything seems to work as what I want. but when I use
firefox to do the testing and when I close the first firefox browser, the
initial cookie value cannot be recognized by the second firefox browser, say
the initial is 22222, the second browser id value will be "12345"
instead(which is a default value.) if this time the web address doesn't have
a specific number attached, but I want 22222. why firefox forgets, but if I
leave the first firefox open, it works. but I did set the expires property,
besides, when you open both IE and firefox two browsers, it seems that the
cookie value set up by one of the browsers cannot be recognized by the other,
I set the domain property and path, how come?
Sincerely
Betty
<%
Dim HttpStr, LiveFlag
LiveFlag=False
If LiveFlag Then
HttpStr="https://"
Else
HttpStr="http://"
End If
pcnumber = Request.ServerVariables("QUERY_STRING")
If NOT isNULL(pcnumber) and Len(pcnumber)>=5 and Len(pcnumber)<=7 Then
Response.Cookies("id") = pcnumber
Else
id = Request.Cookies("id")
If ((IsNull(Trim(id))) OR (Trim(Len(id)) = 0)) Then
Response.Cookies("id") ="12345" 'a defualt cookie value
Else
Response.Cookies("id")=id
End If
End If
Response.Cookies("id").Domain = ".domainA.com"
Response.Cookies("id").Expires = "December 31, 2020"
Response.cookies("id").path="/"
id = Request.Cookies("id")
Function WriteLinkPgm(byVal DomainB, byVal Pgm, byVal DisplayText)
WriteLinkPgm="<A HREF=" & HttpStr & DomainB & Pgm & "?" & id & ">" &
DisplayText & "</A>"
End Function
%>