Results 1 to 10 of 10

Thread: Increasing Session.timeout

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Increasing Session.timeout

    How do I increase the time before a session times out in .net ?

    I would like to use the webconfog or global asa if possible.

    TIA

  2. #2
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Chesterfield, UK
    Posts
    298
    Generally, I would say use the option within IIS to change the session timeout.

    Why would you want to put it within your web.config or any other file for that matter??

    Matt.

  3. #3

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    I thought that whatever timeout you set in code would overwrite the IIS session stuff.

  4. #4
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Chesterfield, UK
    Posts
    298

    Well

    Ok, sure.

    Well it is in the config.web file :

    Code:
    <configuration>
      <sessionstate 
          mode="inproc"
          cookieless="false" 
          timeout="20" 
          sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
          server="127.0.0.1" 
          port="42424" 
      />
    </configuration>
    Matt.

  5. #5

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    This is what I have :

    Code:
     <sessionState 
                mode="InProc"
                stateConnectionString="tcpip=127.0.0.1:42424"
                sqlConnectionString="data source=127.0.0.1;user id=sa;password="
                cookieless="false" 
                timeout="600" 
        />
    The problem is that the sessions are timing out after about 20 mins and I have no idea why.

    Any ideas ?

  6. #6
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Chesterfield, UK
    Posts
    298
    If the webserver is set to 20 minutes then thats what will happen.

    I am not 100% on this, but the web.config wouldn't override the webserver anyhow.

    The web.config control the timeout of the current web that you are in and not the entire webserver, so if the webserver is killing the session after 20 mins, then you will have to extend its timeout.

    Why not try changing the webserver timeout to 5 mins and see if that kills the session after the 5 minutes.

    Or set the webserver to 20 minutes and the web.config to 5 minutes and see if your session stops after 5 minutes.

    I am not any kind of expert on this, as I always use the IIS timeout.

    If any of this is of any use, i will be suprised, but its worth a go.

    Matt.
    Last edited by MattJH; Apr 30th, 2004 at 06:16 AM.

  7. #7
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092
    The timeout that you set in web.config or anywhere in code
    "session.timeout = x" SHOULD overide the value set in IIS, at least according to our hosts technical team and some microsoft sites.

    Why would you want to put it within your web.config or any other file for that matter??
    People don't always have access to IIS management, for example if your hosting on a shared server.

    I had loads of trouble with this though, read through this thread, see if there's any help in it Session timeout length

  8. #8

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    I have changed IIS to 600 and it still times out at between 15 and 20 minutes.

    This is driving me nuts.

  9. #9
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Chesterfield, UK
    Posts
    298
    Just a couple of questions :

    Is this happening with just this asp.net application, or others as well?

    Have you tried to recompile the program after setting the timeouts on the server and in web.config??

    Still looking into it, will post back if I can think of anything else.

    Matt.

  10. #10
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Chesterfield, UK
    Posts
    298
    What version of asp.net are you using??? Is it version 1.0??

    If so you may need to upgrade to 1.1
    http://www.asp.net/download-1.1.aspx?tabindex=0&tabid=1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width