2

I'm developing an ASP.NET 4 webforms app on my Windows 7 PC. I'm running VS2010 and IIS7.5.

I have a weird problem where after a few page loads (anywhere from 1 to 20ish) I get NO response from IIS. I can't even hit a breakpoint in Application BeginRequest, I just get nothing. But, if I delete all cookies from the browser for the development domain, the website will load perfectly again for a few more requests.

This happens in all browsers I have installed (IE9, Firefox, Chrome, Safari, Opera). However, if I deploy the app to our hosted server, all works fine.

Anyone had this issue before?

Many thanks for any help you can provide.

Netricity
  • 2,550
  • 1
  • 22
  • 28
  • 2
    This is sounds like you add, too big in size, cookies on your application and browser can not handle them. – Aristos Jun 24 '11 at 13:26
  • /agree Aristos - just what are you putting in your cookies? – The Evil Greebo Jun 24 '11 at 13:28
  • Are you putting extra chocolate chips in those cookies? – Mantorok Jun 24 '11 at 13:36
  • I have 6 cookies, 3 are 'built in' .ASPXFORMSAUTH, .ASPXROLES, ASP.NET_SessionId. The other 3 each contain only a few bytes of data. I saved the contents of all in a text file and this totalled less than 1.5k. But like I said, when I deploy this app to our hosted server, all works fine. – Netricity Jun 24 '11 at 13:50
  • 1
    There may be some limits in IIS when running locally, what happens if you leave the cookies and restart IIS? You could also disable keep-alives on the server if you don't require them. – Mantorok Jun 24 '11 at 14:12
  • @Aristos and @Mantorok - thanks, your suggestion has fixed this. I stopped the largest cookie (.ASPXROLES) from being generated and now all requests have been working for the past couple of hours. Many thanks, this has been causing me problems for a long time. – Netricity Jun 24 '11 at 16:29

1 Answers1

1

After the comments I add for reference here an answer.

This is an issue when you place too large cookie to the browser and browser can not handle them.

The reason that is play here, not play there maybe because of the data that you have type on it and save on cookies.

You can search for cookie limits on the internet and for different browsers. For ie for example http://support.microsoft.com/kb/306070

Try to keep the cookie size as low as you can.

From antmx

For reference, here is what I changed in web.config to fix this problem.

<roleManager cacheRolesInCookie="false" /> 

Note, though, that now a user's roles will be read from the database each time they're needed, which could cause a performance issue. (I am not think that there is any performance issue and is more secure this way)

Aristos
  • 66,005
  • 16
  • 114
  • 150
  • thanks again. I had put too much faith in the automated feature of ASP.NET Roles, and as the number of roles has increased in this system it appears to have exceeded some kind of browser limit. For reference, here is what I changed in web.config to fix this problem. Note, though, that now a user's roles will be read from the database each time they're needed, which could cause a performance issue. – Netricity Jun 24 '11 at 18:14