Click here to Skip to main content
15,923,006 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have developed a website in asp.net4.0 in this website when user Log in then after 20 minutes automatic session expires and user go to again login page and re login .
i want to extend session state value to 4 hours how it is possible.

Thank You
Posted

Increase the timeout in the Web.Config file:
XML
<system.web>
  <sessionState mode="InProc" timeout="240"></sessionState>
</system.web>

This would set the timeout as 240 minutes for your web application if that's what you really want to set.
 
Share this answer
 
v2
Open web.config file from your website and set this parameter.


XML
<system.web>
  <sessionState mode="InProc" timeout="240"></sessionState>
</system.web>
 
Share this answer
 
Open web.config and type this code after <system.web> tag:
HTML
<sessionstate timeout="4" mode="InProc"></sessionstate>


HttpSessionState.Timeout Property
 
Share this answer
 
in web.config file setting the timeout property in minutes for 4hr 60*4=240min. write like this
XML
<sessionstate timeout="240" />

for more look this Article[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900