tags:

views:

111

answers:

3

hello. I have user log in logic in my web app. after successful log in, i set the user id in Session, so i can keep track of the user. and in my master file page load event, i do

Session.timeout = 60

so session should timeout after an hour. but my session times out at around 10 - 20 minutes. What am i doing wrong? i bet it's obvious.

+3  A: 

It is probably due to your IIS settings. In IIS the default timeout for a session is 20 min.

Use the IIS manager to change it.

Shiraz Bhaiji
oh found it in iis. it indeed is 20 minutes. good one, sir.
Funky Dude
+1  A: 

Have you tried setting it in your web.config instead of server side code?

<configuration>
  <system.web>
    <sessionState 
      mode="InProc"
      cookieless="true"
      timeout="60" />
  </system.web>
</configuration>
David Stratton
+1  A: 

If your app is crashing and re-starting at all, your sessions will be lost.

I'd setup some Health Monitoring and setup a notification for your app re-starting. If it happen more often than your 20 minutes then something is crashing your app.

Slee