简体   繁体   中英

IIS7 Application Pool crash when reading cookies

This one is a real challenge: I've set IIS7.5 on my computer and started to develop a website. Each night I'm backing it up on my web server, win 2008r2 sp1 (all updates). It works flawlessly.

Yet, I've encountered a huge problem when sharing cookies across application pools. www.example.com was set to 127.0.0.1 so I could test the website locally. It created cookies BUT when I removed the HOSTS record (to point back to web server) - the application pool on the web server crashed. It happens each and every time, and might have to do something with the sessionID cookie, since without cookies it DOESNT crash!

the log file is:

Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: nlssorting.dll, version: 4.0.30319.239, time stamp: 0x4e182039
Exception code: 0xc00000fd
Fault offset: 0x0000000000001d7d
Faulting process id: 0x9f8
Faulting application start time: 0x01ccbbd76b7a443c
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\nlssorting.dll
Report Id: a9cfd0cf-27ca-11e1-bced-00215e5304da

What is going on?

ASP.NET auth cookie gets encrypted and decrypted using the machineKey setting in web.config. If you don't have it there, it is auto-generated each time app starts. It's a good idea to set it to a fixed value to avoid cookie invalidation between app restarts.

I can't be sure, but it might be that asp.net session cookie is also dependent on this encryption key. I'm pretty sure viewstate is using it also (this would be why you see invalid-viewstate errors when you initiate a postback after the app was shut down due to inactivity).

So, try setting the machine key and see it that still happens. You can use IIS to generate one, and it'll insert it into the correct spot within the web.config.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM