First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
« Zero to Three Month Baby Ultimate Tools ... | Main | Running Mac OS X Tiger  »

Jon Box ran into a crazy bug today with ASP.NET, IIS and Cookie handling. These are my favorite bugs. I love sniffing HTTP traffic; not sure why.

I had thought that his cookie was being dropped due to a missing P3P privacy policy. Turns out, it seems, that his server name was like SERVER_NAME and that an underscore is outside of the RFC guidelines, specificaly RFC 1034 and RFC 1035. His IIS support guy at Microsoft pointed to Q222823 that mentions a warning message you'd get when naming your server in this non-standard way:

"The computer name "computer name" contains one or more non-standard characters. Standard characters include letters (A-Z, a-z), digits (0-9), and hyphens. Using a non-standard name will prevent other users from finding your computer on the network, unless your network is using the Microsoft DNS Server. Do you wish to use this non-standard name?"

The conclusion is that ASP.NET doesn't handle cookies properly unless the DNS name of the server in question is within specifications for standard naming. Seems obivous in retrospect, but the fact that the cookie is just dropped doesn't automatically lead one to this conclusion. Kudos to Jon for sticking to the problem. If he posts more details on his blog, I'll add a link.

UPDATE: Looks like it's IE, not ASP.NET, and for security purposes. Thanks Jeff Berkowitz!

Tracked by:
"Scott rocks" (Keyvan Nayyeri) [Trackback]
"Avoid Servers Names with Hyphens or Underscores" (.NET Musings) [Trackback]
"What Do You Need To Know?" (Wayne Allen's Weblog) [Trackback]


Thursday, January 12, 2006 10:58:41 PM (Pacific Standard Time, UTC-08:00)
I had exactly the same issue a few year ago. I was pulling my hair why my cookie wasn't working and it happened to be this issue. Changing the name of the machine certainly solved the problem. It took me pretty much the whole day to find the solution...
Friday, January 13, 2006 2:11:37 AM (Pacific Standard Time, UTC-08:00)
Howdy,

I encountered the same problem in the days before .Net.
We traced it to the underscore in the name, but it was Internet Explorer that would not accept the cookies from this server name.

Worse than that, whilst trying to fathom the problem, we had one older version of IE that would, and the newer more secure version that would not which proved to be a real red herring.


Friday, January 13, 2006 7:01:59 AM (Pacific Standard Time, UTC-08:00)
Similar problem in a pre .NET ASP environment. In this scenario, we were adding sites to the Trusted Zone. If instead of adding the ServerName to the Trusted Zone, we used the IP Address, everything worked OK.

theCoach
Friday, January 13, 2006 2:52:44 PM (Pacific Standard Time, UTC-08:00)
This bug (really "intentional breaking change") was a documented consequence of a security fix: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q312461

Jeff
Jeff Berkowitz
Comments are closed.

Contact

Sponsors

Hosting By

On this page...

Tags

Calendar

<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Archives

Google Ads