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 worker process that runs the web application by default, if the worker process is recycled, it will cause loss.
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 you use StateServer or SQL Server database to save the session, this setting is not affected.
Possible cause 2:
The system must run in a load balancing web environment, 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 is mainly because the user accesses the web application system through the load balancing IP address, and saves the session Status of a session on a server at a certain time, 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. For specific settings, visit the Microsoft support website.