Possible cause 1:
IIS6 under win2003 server is set by default. After more than 20 hours, every worker process running in the default application pool is automatically reclaimed, resulting in the loss of session stored in the process.
Because session, application, and other data are stored in the running web application by default.ProgramIf the worker process is recycled, the process will be lost.
Solution:
Modify the configuration and set it to automatically recycle the worker process from time to time. For example, set it to automatically recycle the worker process when it exceeds 60% of the occupied physical memory.
This process. By using the default application pool, you can ensure that multiple applications are isolated from each other, so that the crash of one application will not affect other web applications. It also allows an Independent Application to run under a specified user account privilege.
If session is saved using StateServer or SQL Server database, this setting is not affected.
Possible cause 2:
The system must run in the web environment of load balancing, and the system configuration file web. the session Status in config is set to inproc (that is, the session status is stored locally), which leads to the situation where the session often times out when the user's access volume is large. This problem occurs mainly because the user accesses the Web Application System by Using the load balancing IP address. At at certain time, the session state of a session is saved on a server, however, the session Status of the session is not saved on other Web Front-end servers. As the concurrency increases, the load balancing function can be used as a route to access idle servers at any time, as a result, the idle server does not have the previously saved session status.
Solution:
1. when you run ASP. net web applications must use sqlserver or StateServer session Status mode. In the project, we did not select sqlserver mode to store session status based on performance considerations, instead, select a sessionstateserver server to view the session Status of the user. We need to set the following in the System Configuration File web. config:
<Sessionstate mode = "StateServer" cookieless = "false" timeout = "240" stateconnectionstring = "TCPIP = 192.168.0.1: 42424" statenetworktimeout = "14400"/>
Add another item
<Machinekey validationkey = "Hangzhou" decryptionkey = "5fc88dfc24ea123c" validation = "sha1"/>
2. we also need to start ASP on the sessionstateserver server. net State service, specific settings: Control Panel> Management Tools> services> Asp. net State service, set it to automatic start.
3. Microsoft "Internet Information Service" (IIS) settings for each front-end Web Service
To maintain the session status between different Web servers in the Web farm, Microsoft "Internet Information Service" (IIS) configures the Application Path of the web site in the database (for example, \ lm \ W3SVC \ 2) must be the same as all Web servers in the Web field. The application path must be case sensitive. On a Web server, the instance id of the Web site that hosts ASP. NET Applications may be 2 (where the application path is \ lm \ W3SVC \ 2 ). On another Web server, the instance id of the web site may be 3 (where the application path is \ lm \ W3SVC \ 3 ). Therefore, the application paths between Web servers in the Web field are different. We must make the instance IDs of the Web site the same. You can save a web configuration as a file in IIS. the IIS configuration of other web servers can come from this file. If you want to know the specific settings, visit the Microsoft support website:
Additional information:
PRB: Session variables are lost if you use frameset in Internet Explorer 6.0
Http://support.microsoft.com/kb/323752/EN-US /#
PRB: session data is lost when you use ASP. NET inproc session state Mode
Http://support.microsoft.com /? Id = 324772
PRB: If you use sqlserver or StateServer session mode, the Web field will lose the session status.
Http://support.microsoft.com/default.aspx? SCID = KB; ZH-CN; 325056 ASP. NET session state FAQ
Http://www.eggheadcafe.com/articles/20021016.asp