Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forms Authentication fails to recognize as logged in under IE when underscore in hostname

In my asp.net webforms application I am using plain and simple forms authentication hooked up into my database (with the standard membership provider). Everything works well, I can log in , log out, get roles, etc...

However, after deploying my site to the intranet IIS server I noticed that IE cannot be authenticated. The actual authentication process for logging in works (as it does tell you when your password/username is wrong) but after authentication completes it claims you aren't logged in.

This is only on my deployed IIS environment as locally while in my VS environment everything works just fine in IE. While in the deployed IIS chrome and Firefox work just fine.

The only thing I can tell is it looks like IE isn't getting or saving the authentication cookie. This is not IE setting related as I have my IE8 set to accept all cookies, and I tested on a coworker's IE8 machine and another's IE7 with the same results.

My web.config is using the following settings:

<authentication mode="Forms" >
  <forms cookieless="UseCookies" />
</authentication>  

Does anyone at least have a clue on where I would look to begin debugging this issue?

Thanks,


Edit: I have been forced to fix this issue now, since my webserver is not working well with URL authentication.

I have used fiddler and figured out that IIS7 is not sending any cookies to me when I am in IE. No cookies are in the headers. The cookies are correctly in the headers when serving the site to Mozilla and Chrome browsers though. I am at a loss as to why.....


Edit2: As a side note, when I log into the web server directly, if I go to Http://localhost/ IIS sends IE the cookies fine, but if I go to http://qa_build/ (that's the computer name for the server) IIS won't send the cookies to IE.

like image 624
KallDrexx Avatar asked Jun 29 '10 20:06

KallDrexx


1 Answers

Finally figured out the answer. It turns out if the domain has an underscore in it, Internet Explorer will not store cookies. Changing the computer's name to qabuild fixed it.

http://support.microsoft.com/kb/316112

like image 58
KallDrexx Avatar answered Sep 28 '22 20:09

KallDrexx