Click here to Skip to main content
15,891,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do I set session state to expire after 6 hours and the application pool never expires in asp.net and IIS 7 ?
Posted
Comments
F-ES Sitecore 3-Oct-15 7:56am    
You won't be able to do either of those things. IIS will recycle the app pool and expire sessions when it needs to based on various factors. Setting a session timeout value isn't going to guarantee the session will last that long. Think about it...you have a 6 hour session time and your site gets 100 new visitors a minute, how is the server going to manage all those sessions? Resources are finite.

Rather than trying to do the impossible you should concentrate on architecting a solution that doesn't need 6 hour sessions etc.

For Application Pool Timeout:
http://weblogs.asp.net/owscott/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes[^]

For Session Timeout in IIS:
https://www.iis.net/configreference/system.webserver/asp/session[^]

For Session Timeout in Web.config:
XML
<configuration>
  <system.web>
     <sessionState timeout="360"></sessionState>
  </system.web>
</configuration>
 
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