Cookie only sets in IE and not firefox/chrome

2019-09-17 11:21发布

问题:

I have an ASP.NET 2.0 web application. Cookies worked fine on all browsers on windows server 2008 for several years.

We upgraded to a new server with windows server 2012(IIS8), the first day during testing cookies were not being set in firefox so we could not login(not sure about chrome). Next day, with no changes, it seemed to all work OK.

Fast forward another month or so, firefox and chrome will not set the cookies (looking in chrome dev tools and firebug) but its still working in IE and I can see the cookie set in IE dev tools.

Cookie values are being set though

HttpContext.Current.Response.Cookies[][]

Does anyone have any clue why this might be, or where I should start trying to diagnose this issue?

回答1:

We had the same issue on our dev server and spent hours to find the root cause for it. Login would work on IE but not on FF and Chrome. We finally got the problem. Not sure how relevant our solution will be for others, but I thought I will post it here and it may help out someone someday.

In our case, after trying a lot of things we finally restarted the server and then came to know that the SSL certificate has expired and that is what was causing the issue. Disabling SSL completely made login work again. We renewed the SSL and enabled SSL and everything is fine now.