Reputation: 33711
I upgraded a .net 2.0 application to net 4.0 and now if I try to login with IE the session instantly expires.
Does anyone have any ideas on where to look for this problem?
Firefox works fine to log in.
Thanks.
Edit, More Information: Checking IE's cookies and firefox's cookies, it appears that a cookie is not being created in I.E, but it is being created in firefox. Any ideas on why this might be? Still digging into it but having a hard time...
LAST EDIT; FIXED: Turns out this was not relevant to asp 4.0. I upgraded the application and set it up on a subdomain for testing to ensure everything worked, and the sub domain had an _ in it. After much research, IE will not take cookies from a domain with an _. This is done on purpose by design, apparently, since technically DNS rules forbid underscores in a domain. Changed to a - and it works.
Upvotes: 4
Views: 1301
Reputation: 33711
LAST EDIT; FIXED: Turns out this was not relevant to asp 4.0. I upgraded the application and set it up on a subdomain for testing to ensure everything worked, and the sub domain had an _ in it. After much research, IE will not take cookies from a domain with an _. This is done on purpose by design, apparently, since technically DNS rules forbid underscores in a domain. Changed to a - and it works.
Upvotes: 2
Reputation: 502
If your application is working fine on Firefox and then it might be because of IE 8. IE 8 have different settings for cookie handling. Here is the remedy for that problem:-
1) Tools -> Internet Options ->Privacy -> Advance-> Check Override automatic cookie handling. 2) Select Accept in First-party Cookies and Select Accept Third-party cookies 3) Check Always allow session cookies
If you can't change the settings on client browser then try cookieless sessions. To do this just define:-
<sessionState cookieless="true" />
in your web config file.
For Details of cookieless sessions:-
http://msdn.microsoft.com/en-us/library/aa479314.aspx
Upvotes: 0