G
Guest
Hi all.
I have a scenario where it appears that multiple cookies are created.
We are using ASP.NET 2.0, and one of our pages reads a cookie and display
the value to the web page, using client side JS. This is accomplished by
parsing the document.cookie property.
Here is the scenario. We have one site that has both the headers of
xyz.com.au and www.xyz.com.au
A user browses to xyz.com.au An operation on this page sets a persistent
cookie ( serverside ) key of "abc" and value of "def" with the DOMAIN
property of the cookie set to xyz.com.au
When the page re-renders there is a string in the document.cookie "abc=def",
as well as some other cookie values used by ASP.NET ( ie sessionID, etc ).
If the user is redirected, or browses directly, to www.xyz.com.au, we can
still read the cookie as described above, both server and client side. If
the user performs the same operation as above, we set the persistent cookie
key : "abc" and this time another value "ghi". The DOMAIN property of the
cookie is STILL xyz.com.au
However, this time the document.cookie property in JS contains 2 abc cookies:
abc=def&abc=ghi. Now the client side script cannot distinguish between the
2. Also, the order of the cookie appears to inconsistent.
We never had this problem when the site was running under ASPNET 1.1
Cheers...
Robert
I have a scenario where it appears that multiple cookies are created.
We are using ASP.NET 2.0, and one of our pages reads a cookie and display
the value to the web page, using client side JS. This is accomplished by
parsing the document.cookie property.
Here is the scenario. We have one site that has both the headers of
xyz.com.au and www.xyz.com.au
A user browses to xyz.com.au An operation on this page sets a persistent
cookie ( serverside ) key of "abc" and value of "def" with the DOMAIN
property of the cookie set to xyz.com.au
When the page re-renders there is a string in the document.cookie "abc=def",
as well as some other cookie values used by ASP.NET ( ie sessionID, etc ).
If the user is redirected, or browses directly, to www.xyz.com.au, we can
still read the cookie as described above, both server and client side. If
the user performs the same operation as above, we set the persistent cookie
key : "abc" and this time another value "ghi". The DOMAIN property of the
cookie is STILL xyz.com.au
However, this time the document.cookie property in JS contains 2 abc cookies:
abc=def&abc=ghi. Now the client side script cannot distinguish between the
2. Also, the order of the cookie appears to inconsistent.
We never had this problem when the site was running under ASPNET 1.1
Cheers...
Robert