How to Configure Session Timeout in web.config
To set the session timeout value for an in-process session in an ASP.Net web application, you need to modify the web.config file. Here's how to do it:
Problem:
You've been unable to set the session timeout value for an in-process session in your ASP.NET web application.
Solution:
In the web.config file, locate the
<sessionState timeout="1" mode="InProc" />
This code specifies that the session timeout should be set to 1 minute and that the session should be stored in-process.
Extended Example:
If you want to set the timeout to 20 minutes, you would modify the code as follows:
<configuration> <system.web> <sessionState timeout="20" /> </system.web> </configuration>
The above is the detailed content of How to Configure ASP.NET Session Timeout in web.config?. For more information, please follow other related articles on the PHP Chinese website!