-1

im using forms autentication and i have timeout of 80 min . but while working with application , in 5 minutes its again going to login page. how to increase my session time out in web.config file ?

<authentication mode="Forms">
         <forms loginUrl="~/Login.aspx" protection="All" timeout="120" name="ShoppingCartCookie" requireSSL="false" slidingExpiration="true" defaultUrl="login.aspx" cookieless="UseCookies" enableCrossAppRedirects="false" />
 </authentication>


 <system.web>
   <sessionState mode="InProc" cookieless="false" timeout="80" />
 </system.web>
krishna mohan
  • 437
  • 1
  • 4
  • 18

1 Answers1

0

The problem is usually IIS in this case. It's the Application Pool that is refreshing after 5 minutes, not your Session that is expiring. Go into the IIS management console. Find out which Application Pool your website is using.

Then you need to up the session timeout value of the Application Pool - ideally it should be higher than that of the actually Session Timeout value your set for your website.

Also look in your code for any Session.Timeout = 5; if you're working in a team you may find someone snuck in that little gem.

Hugo Yates
  • 2,081
  • 2
  • 26
  • 24
  • i have not hosted my application in iis , then why to check iis settings?@Hugo Yates – krishna mohan Mar 18 '15 at 09:53
  • how to know which application pool is used in my application ? – krishna mohan Mar 18 '15 at 09:55
  • Can you access the IIS management console and what version of IIS are your using; 6 or 7.5? – Hugo Yates Mar 18 '15 at 10:02
  • im using 7.5 version iis @Hugo Yates – krishna mohan Mar 18 '15 at 10:51
  • Right go into IIS, Right click on your site on the left tree view. Manage Application > Advanced Settings. You'll get a dialogue box up, the item at the top should be "Application Pool". Close that. Back on the left you'll have "Application Pools", click on that and find the Application Pool you're using (You can create a new Pool if required). Right click the pool and select "Advanced Settings". `Idle Time-out (minutes` is what you're after (default is 20 minutes). – Hugo Yates Mar 18 '15 at 13:42