I tried following codes to increase session timeout, but no use,
code is:
<sessionState mode="InProc" cookieless="true" timeout="60"> </sessionState>
Also code at
void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started Session.Timeout = 15; }
Click Servers > Server Type > WebSphere Application Servers > CongnosX_GW2. Click Container Settings > Session management > Set Timeout. Enter the desired timeout value in minutes. Click OK.
Open the web. config file, then increase the value in minutes by using the time out attribute of SessionState element. By default, the session timeout value is 20 minutes. Also in your case if you are using forms authentication, please check the timeout value.
Expand the local computer node, expand "Web Sites", right-click the appropriate website, and then click Properties. 3. Click the "Web Site" tab. 4.In the Connections area, change the value in the "Connection timeout" field, and then click OK.
Yes, we can set the session timeout manually in web. config. In ASP.NET we can set the session timeout in the web.
You can increase the session time-out in asp.net in any one of the following ways
Using IIS Version 7 :
OR
Web.config : Open up your web.config file and under the system.web section add the following :
<sessionState timeout = "20" mode = "InProc" />
Replace 20 with whatever number you wish.
OR
Global.asax file : Under the Session_Start method, set the timeout property of the session to the required value like this
Session.Timeout = "20";
Note : If you are setting a session timeout in both IIS as well as web.config, then the one in IIS will override the one in web.config
Hope this helps!
If you are using forms authentication then the default value of session timeout is 30min.Try this code to increase session timeout.
<system.web> <authentication mode="Forms"> <forms timeout="70"/> </authentication> <sessionstate timeout="80"/> </system.web>
I think the code help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With