The IIS6 default setting under Win2003 server automatically reclaims each worker process running in the default application pool after more than more than 20 hours, causing the session to be saved in that process to be lost.
Because data such as Session,application is saved by default in the worker process running the Web application, if the Recycle worker process is lost.
Solution:
Modify the configuration to automatically recycle the worker process when it is indeterminate, for example, set to automatically recycle after 60% of the existing physical memory is exceeded
The process. By using the default application pool, you can ensure that multiple applications are isolated from each other, ensuring that a crash of one application does not affect another Web application. You can also enable a stand-alone application to run under a specified user account privilege.
If you use the StateServer method or the SQL Server database method to save the session, you are not affected by this setting.
Possible reason 2:
The system is to run in a load-balanced Web farm environment, and the session state in the system profile Web.config is set to InProc (that is, to store conversation state locally), which leads to a timeout when the user accesses a large number of times. The cause of this phenomenon is mainly because the user through the load-balanced IP to access the Web application system, a certain time in a server to save session state sessions, but in other Web front-end server does not save session state, and with the increase in the amount of concurrency, Load balancing is used as a route to access idle servers at any time, and the resulting idle server does not have the session state previously saved.
Solution:
1. When you run a asp.net Web application in a load-balanced Web farm environment, be sure to use SQL Server or StateServer session state mode, where we do not choose SQL Server mode to store the sessions State based on performance considerations. Instead, select a sessionstateserver server to be the session state of the user. We want to set the following in the system configuration file Web.config:
Also add an item
2. We also have to start the ASP.net state service in the Sessionstateserver server, specific settings: Control Panel >> admin Tools >> Service >>asp.net State Service, set it to start automatically.
3. Microsoft Internet Information Services (IIS) settings for each front-end Web service
To maintain session state between different Web servers in a Web farm, the application path (for example, \lm\w3svc\2) of the Web site in the Microsoft Internet Information Services (IIS) configuration database must be the same as for all Web servers in the Web farm. The case must also be the same, because the application path is case-sensitive. On a Web server, the instance ID of the Web site hosting the asp.net application 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 path between Web servers in the Web farm is different. We must have the same instance ID for the Web Farm Web site. You can save one web configuration information as a file in IIS, and the IIS configuration of other Web servers can come from this file. If you want to know the specific settings, please visit the Microsoft Support Web site.