By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,583 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,583 IT Pros & Developers. It's quick & easy.

double cookies - same name - .Net bug?

P: n/a
I'm using the following code in my .Net application (.Net v1.1, Windows
2000) to write Session Cookies.
HttpContext.Current.Response.Cookies("cookieSessio n")("SessionID") =
strSessionID

HttpContext.Current.Response.Cookies("cookieSessio n")("Site_ID") =
strSite_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("LanguageCode_ID")
= strLanguageCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("ShipZip") =
strShipZip

HttpContext.Current.Response.Cookies("cookieSessio n")("blnLoadDynSide")
= blnLoadDynSide

HttpContext.Current.Response.Cookies("cookieSessio n")("blnProdView") =
blnProdView

HttpContext.Current.Response.Cookies("cookieSessio n")("blnHasCart") =
blnHasCart

HttpContext.Current.Response.Cookies("cookieSessio n")("CatalogCode_ID")
= strCatalogCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("SegmentTypeCode_ID")
= strSegmentTypeCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n").Expires =
DateTime.Now.AddDays(10)

Arbitrarily, in Internet Explorer, the cookie is written twice. This
causes major issues w/ my Ecommerce application.

Here's what the IIS log files look like. Notice the cookie with the
same name in there twice.

2005-07-18 16:36:07 172.191.129.192 - 192.168.71.201 443 GET
/Product/Product-CheckoutSummary.aspx - 200 66080 1026 360 HTTP/1.1
www.mydomain.com Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)
WEBTRENDS_ID=207.200.116.5-1678957136.29722584;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=1&blnProdView=1&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+WEBTR ENDS_ID=207.200.116.6-1977234432.29722583;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =91364&blnLoadDynSide=1&blnProdView=1&blnHasCart=0 &CatalogCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+ ASP.NET_SessionId=v4qore3eak3zrzjcirgqpkut
https://www.mydomain.com/Product/Pro...utBilling.aspx
Anyone seen this before and fixed it. Newsgroups an KBs are not
helping me so far.

Nov 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On your logs looks like there are 2 different IPs:
207.200.116.5
207.200.116.6

Could be one request going to the first IP the second going to the second IP
that's why 2 cookies are being sent with 2 diferent domain?

Just an idea, give me the set up of your IIS. THanks
AL

"DJones" wrote:
I'm using the following code in my .Net application (.Net v1.1, Windows
2000) to write Session Cookies.
HttpContext.Current.Response.Cookies("cookieSessio n")("SessionID") =
strSessionID

HttpContext.Current.Response.Cookies("cookieSessio n")("Site_ID") =
strSite_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("LanguageCode_ID")
= strLanguageCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("ShipZip") =
strShipZip

HttpContext.Current.Response.Cookies("cookieSessio n")("blnLoadDynSide")
= blnLoadDynSide

HttpContext.Current.Response.Cookies("cookieSessio n")("blnProdView") =
blnProdView

HttpContext.Current.Response.Cookies("cookieSessio n")("blnHasCart") =
blnHasCart

HttpContext.Current.Response.Cookies("cookieSessio n")("CatalogCode_ID")
= strCatalogCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("SegmentTypeCode_ID")
= strSegmentTypeCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n").Expires =
DateTime.Now.AddDays(10)

Arbitrarily, in Internet Explorer, the cookie is written twice. This
causes major issues w/ my Ecommerce application.

Here's what the IIS log files look like. Notice the cookie with the
same name in there twice.

2005-07-18 16:36:07 172.191.129.192 - 192.168.71.201 443 GET
/Product/Product-CheckoutSummary.aspx - 200 66080 1026 360 HTTP/1.1
www.mydomain.com Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)
WEBTRENDS_ID=207.200.116.5-1678957136.29722584;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=1&blnProdView=1&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+WEBTR ENDS_ID=207.200.116.6-1977234432.29722583;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =91364&blnLoadDynSide=1&blnProdView=1&blnHasCart=0 &CatalogCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+ ASP.NET_SessionId=v4qore3eak3zrzjcirgqpkut
https://www.mydomain.com/Product/Pro...utBilling.aspx
Anyone seen this before and fixed it. Newsgroups an KBs are not
helping me so far.

Nov 19 '05 #2

P: n/a
Domain name is pointed to 216.52.152.116. ISP has a redirect to
192.168.71.201.

The visitor to this site was an AOL person (The
207.200.116.5,207.200.116.6, and the logged IP of 172.191.129.192 are
all pointed to AOL.
), and AOL has multiple proxies. So, my webserver receives requests
from multiple sources. Hmmm... Shouldn't be this way.

Cookies are supposed to be domain name specific, I thought and
shouldn't write a cookie for each IP it comes in on.

I went back to this person's initial visit and they doubled up right
away, so now I'm even more perplexed. Here's their initial IIS record
from 5 days earlier (notice that it's doubled up too).

2005-07-13 18:26:30 207.200.116.65 - 192.168.71.201 80 GET
/Default.aspx - 200 29308 871 16 HTTP/1.1 www.littletikes.com
Mozilla/4.0+(compatible;+MSIE+6.0;+AOL+9.0;+Windows+NT+5.1 )
WEBTRENDS_ID=207.200.116.6-1977234432.29722583;+ASP.NET_SessionId=u3ny4cerd5b lwoaqvambta45;+cookieSession=SessionID=96b1863b-0a56-443f-b080-3d9479c2f252&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=1&blnProdView=1&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+WEBTR ENDS_ID=207.200.116.5-1678957136.29722584;+ASP.NET_SessionId=wq01u4asvij qdt55to3bqkvy;+cookieSession=SessionID=b8bbf19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=0&blnProdView=0&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0
-

I am going to disable my Webtrends ISAPI cookie. This may be one of
the root causes as well. Thanks for the help.

Albert Pascual wrote:
On your logs looks like there are 2 different IPs:
207.200.116.5
207.200.116.6

Could be one request going to the first IP the second going to the second IP
that's why 2 cookies are being sent with 2 diferent domain?

Just an idea, give me the set up of your IIS. THanks
AL

"DJones" wrote:
I'm using the following code in my .Net application (.Net v1.1, Windows
2000) to write Session Cookies.
HttpContext.Current.Response.Cookies("cookieSessio n")("SessionID") =
strSessionID

HttpContext.Current.Response.Cookies("cookieSessio n")("Site_ID") =
strSite_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("LanguageCode_ID")
= strLanguageCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("ShipZip") =
strShipZip

HttpContext.Current.Response.Cookies("cookieSessio n")("blnLoadDynSide")
= blnLoadDynSide

HttpContext.Current.Response.Cookies("cookieSessio n")("blnProdView") =
blnProdView

HttpContext.Current.Response.Cookies("cookieSessio n")("blnHasCart") =
blnHasCart

HttpContext.Current.Response.Cookies("cookieSessio n")("CatalogCode_ID")
= strCatalogCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("SegmentTypeCode_ID")
= strSegmentTypeCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n").Expires =
DateTime.Now.AddDays(10)

Arbitrarily, in Internet Explorer, the cookie is written twice. This
causes major issues w/ my Ecommerce application.

Here's what the IIS log files look like. Notice the cookie with the
same name in there twice.

2005-07-18 16:36:07 172.191.129.192 - 192.168.71.201 443 GET
/Product/Product-CheckoutSummary.aspx - 200 66080 1026 360 HTTP/1.1
www.mydomain.com Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)
WEBTRENDS_ID=207.200.116.5-1678957136.29722584;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=1&blnProdView=1&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+WEBTR ENDS_ID=207.200.116.6-1977234432.29722583;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =91364&blnLoadDynSide=1&blnProdView=1&blnHasCart=0 &CatalogCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+ ASP.NET_SessionId=v4qore3eak3zrzjcirgqpkut
https://www.mydomain.com/Product/Pro...utBilling.aspx
Anyone seen this before and fixed it. Newsgroups an KBs are not
helping me so far.


Nov 19 '05 #3

P: n/a
This is so weird, cookies should get attached to @domain.com not the IP.
However in your log shows 2 different IPs, Need to check my logs to get an
idea. I'll check back with you soon.

AL
"DJones" wrote:
Domain name is pointed to 216.52.152.116. ISP has a redirect to
192.168.71.201.

The visitor to this site was an AOL person (The
207.200.116.5,207.200.116.6, and the logged IP of 172.191.129.192 are
all pointed to AOL.
), and AOL has multiple proxies. So, my webserver receives requests
from multiple sources. Hmmm... Shouldn't be this way.

Cookies are supposed to be domain name specific, I thought and
shouldn't write a cookie for each IP it comes in on.

I went back to this person's initial visit and they doubled up right
away, so now I'm even more perplexed. Here's their initial IIS record
from 5 days earlier (notice that it's doubled up too).

2005-07-13 18:26:30 207.200.116.65 - 192.168.71.201 80 GET
/Default.aspx - 200 29308 871 16 HTTP/1.1 www.littletikes.com
Mozilla/4.0+(compatible;+MSIE+6.0;+AOL+9.0;+Windows+NT+5.1 )
WEBTRENDS_ID=207.200.116.6-1977234432.29722583;+ASP.NET_SessionId=u3ny4cerd5b lwoaqvambta45;+cookieSession=SessionID=96b1863b-0a56-443f-b080-3d9479c2f252&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=1&blnProdView=1&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+WEBTR ENDS_ID=207.200.116.5-1678957136.29722584;+ASP.NET_SessionId=wq01u4asvij qdt55to3bqkvy;+cookieSession=SessionID=b8bbf19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=0&blnProdView=0&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0
-

I am going to disable my Webtrends ISAPI cookie. This may be one of
the root causes as well. Thanks for the help.

Albert Pascual wrote:
On your logs looks like there are 2 different IPs:
207.200.116.5
207.200.116.6

Could be one request going to the first IP the second going to the second IP
that's why 2 cookies are being sent with 2 diferent domain?

Just an idea, give me the set up of your IIS. THanks
AL

"DJones" wrote:
I'm using the following code in my .Net application (.Net v1.1, Windows
2000) to write Session Cookies.
HttpContext.Current.Response.Cookies("cookieSessio n")("SessionID") =
strSessionID

HttpContext.Current.Response.Cookies("cookieSessio n")("Site_ID") =
strSite_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("LanguageCode_ID")
= strLanguageCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("ShipZip") =
strShipZip

HttpContext.Current.Response.Cookies("cookieSessio n")("blnLoadDynSide")
= blnLoadDynSide

HttpContext.Current.Response.Cookies("cookieSessio n")("blnProdView") =
blnProdView

HttpContext.Current.Response.Cookies("cookieSessio n")("blnHasCart") =
blnHasCart

HttpContext.Current.Response.Cookies("cookieSessio n")("CatalogCode_ID")
= strCatalogCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("SegmentTypeCode_ID")
= strSegmentTypeCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n").Expires =
DateTime.Now.AddDays(10)

Arbitrarily, in Internet Explorer, the cookie is written twice. This
causes major issues w/ my Ecommerce application.

Here's what the IIS log files look like. Notice the cookie with the
same name in there twice.

2005-07-18 16:36:07 172.191.129.192 - 192.168.71.201 443 GET
/Product/Product-CheckoutSummary.aspx - 200 66080 1026 360 HTTP/1.1
www.mydomain.com Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)
WEBTRENDS_ID=207.200.116.5-1678957136.29722584;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=1&blnProdView=1&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+WEBTR ENDS_ID=207.200.116.6-1977234432.29722583;+cookieSession=SessionID=b8bbf 19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =91364&blnLoadDynSide=1&blnProdView=1&blnHasCart=0 &CatalogCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+ ASP.NET_SessionId=v4qore3eak3zrzjcirgqpkut
https://www.mydomain.com/Product/Pro...utBilling.aspx
Anyone seen this before and fixed it. Newsgroups an KBs are not
helping me so far.


Nov 19 '05 #4

P: n/a
Update...... I just found another example of a Non-AOL person. Here
are the log records for when it happens.

Log #1 - Person does a search on the site - cookie fine
===============================
2005-07-18 23:46:33 68.19.214.81 - 192.168.71.201 80 POST
/toys/Toys-List.aspx Page=1&ProductCategory_ID=45&Descripti
on=RIDE-ONS 200 60324 942 125 HTTP/1.1 www.littletikes.com
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.
1;+SV1;+.NET+CLR+1.1.4322)
WEBTRENDS_ID=68.19.214.81-3694346336.29723634;+ASP.NET_SessionId=1oxthp45xba wo
mvyttdmiy45;+cookieSession=SessionID=3ba50d6c-bc0d-467e-909e-00ebd3d3f87d&Site_ID=1&LanguageCode_ID=360
&ShipZip=&blnLoadDynSide=0&blnProdView=0&blnHasCar t=0&CatalogCode_ID=0&SegmentTypeCode_ID=0;+CP=null *
http://www.littletikes.com/
Log #2 - Person clicks product in the search - application writes
"1" to blnLoadDynSide in cookie array. As it will eventually turn out,
this writes a new cookie and leaves the old one intact.
===============================
2005-07-18 23:46:54 68.19.214.81 - 192.168.71.201 80 GET
/toys/Toys-Detail.aspx Product_ID=2323&D
escription=All-in+One%e2%84%a2+Wagon&ProductCategory=RIDE-ONS 200 42511
886 94 HTTP/1.1 www.littletikes.com
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.N ET+CLR+1.1.4322)
WEBTRENDS_ID=68.19.2
14.81-3694346336.29723634;+ASP.NET_SessionId=1oxthp45xba womvyttdmiy45;+cookieSession=SessionID=
3ba50d6c-bc0d-467e-909e-00ebd3d3f87d&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=0&bl
nProdView=0&blnHasCart=0&CatalogCode_ID=0&SegmentT ypeCode_ID=0;+CP=null*
http://www.littletikes
..com/toys/Toys-List.aspx?Page=1&ProductCategory_ID=45&Description =RIDE-ONS

Log #3 - Cookie doubles up after user hits back button and selects
Page 2 from original search
===============================
2005-07-18 23:47:29 68.19.214.81 - 192.168.71.201 80 GET
/toys/Toys-List.aspx ProductAgeRanges_ID=
&ProductCategory_ID=45&Description=RIDE-ONS&SortOrder=&Page=2 200 58673
1070 109 HTTP/1.1
www.littletikes.com
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.N ET+CLR+1.1.4322)

WEBTRENDS_ID=68.19.214.81-3694346336.29723634;+ASP.NET_SessionId=1oxthp45xba womvyttdmiy45;
+cookieSession=SessionID=3ba50d6c-bc0d-467e-909e-00ebd3d3f87d&Site_ID=1&LanguageCode_ID=360
&ShipZip=&blnLoadDynSide=0&blnProdView=0&blnHasCar t=0&CatalogCode_ID=0&SegmentTypeCode_ID=0;
+CP=null*;+cookieSession=SessionID=3ba50d6c-bc0d-467e-909e-00ebd3d3f87d&Site_ID=1&LanguageCode_ID=360
&ShipZip=&blnLoadDynSide=1&blnProdView=0&blnHasCar t=0&CatalogCode_ID=0&SegmentTypeCode_ID=0

http://www.littletikes.com/toys/Toys...ption=RIDE-ONS
Man, I have a love/hate relationship w/ Microsoft and .Net. Who knows,
maybe it's IE doing the doubling up.

Nov 19 '05 #5

P: n/a
Another update.......Comcast person using 1 incoming IP
===========================================
2005-07-19 00:54:18 67.164.128.122 - 192.168.71.201 80 GET
/toys/Toys-Detail.aspx
Product_ID=2466&Description=8-in-1+Adjustable+Playground++&ProductCategory=%3cb%3e1 9+-+24+MONTHS+%3c%2fb%3e%26nbsp%3b
200 37610 1038 203 HTTP/1.1 www.littletikes.com
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.N ET+CLR+1.1.4322)
ASP.NET_SessionId=bccdnj3blq441u2lkz3vkbj0;+cookie Session=SessionID=fd17547d-dcb7-49ee-bd6f-70d8f4f9bea5&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=0&blnProdView=0&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0;+CP=null*;+cooki eSession=SessionID=fd17547d-dcb7-49ee-bd6f-70d8f4f9bea5&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnLoadDynSide=1&blnProdView=0&blnHasCart=0&Cata logCode_ID=0&SegmentTypeCode_ID=0
http://www.littletikes.com/toys/Toys...19+-+24+Months
Same scenario as above, writing the blnLoadDynSide in cookie array to
"1". Causes double up. Here's the code again:

HttpContext.Current.Response.C*ookies("cookieSessi on")("blnLo*adDynSide")

= blnLoadDynSide
HttpContext.Current.Response.C*ookies("cookieSessi on").Expire*s =
DateTime.Now.AddDays(10)

Nov 19 '05 #6

P: n/a

"DJones" <da********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I'm using the following code in my .Net application (.Net v1.1, Windows
2000) to write Session Cookies.
HttpContext.Current.Response.Cookies("cookieSessio n")("SessionID") =
strSessionID

HttpContext.Current.Response.Cookies("cookieSessio n")("Site_ID") =
strSite_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("LanguageCode_ID")
= strLanguageCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("ShipZip") =
strShipZip

HttpContext.Current.Response.Cookies("cookieSessio n")("blnLoadDynSide")
= blnLoadDynSide

HttpContext.Current.Response.Cookies("cookieSessio n")("blnProdView") =
blnProdView

HttpContext.Current.Response.Cookies("cookieSessio n")("blnHasCart") =
blnHasCart

HttpContext.Current.Response.Cookies("cookieSessio n")("CatalogCode_ID")
= strCatalogCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n")("SegmentTypeCode_ID") = strSegmentTypeCode_ID

HttpContext.Current.Response.Cookies("cookieSessio n").Expires =
DateTime.Now.AddDays(10)

Arbitrarily, in Internet Explorer, the cookie is written twice. This
causes major issues w/ my Ecommerce application.

Here's what the IIS log files look like. Notice the cookie with the
same name in there twice.

2005-07-18 16:36:07 172.191.129.192 - 192.168.71.201 443 GET
/Product/Product-CheckoutSummary.aspx - 200 66080 1026 360 HTTP/1.1
www.mydomain.com Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1)
WEBTRENDS_ID=207.200.116.5-1678957136.29722584;+cookieSession=SessionID=b8bb
f19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&ShipZip =&blnL
oadDynSide=1&blnProdView=1&blnHasCart=0&CatalogCod e_ID=0&SegmentTypeCode_ID=
0;+CP=null*;+WEBTRENDS_ID=207.200.116.6-1977234432.29722583;+cookieSession=S
essionID=b8bbf19a-8165-4510-98c2-d03ad9399720&Site_ID=1&LanguageCode_ID=360&
ShipZip=91364&blnLoadDynSide=1&blnProdView=1&blnHa sCart=0&CatalogCode_ID=0&S
egmentTypeCode_ID=0;+CP=null*;+ASP.NET_SessionId=v 4qore3eak3zrzjcirgqpkut https://www.mydomain.com/Product/Pro...utBilling.aspx
Anyone seen this before and fixed it. Newsgroups an KBs are not
helping me so far.


I had a similar but somewhat different problem. I solved it by explicately
settting the .domain property of the cookie to mysite.com .
Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.