|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Session and Connection Timeout
Hi,
Can anyone confirm if my understanding of Session Timeout is correct? I always thought that the IIS Session Timeout value would be overridden by any Session.Timeout = nn directive I put in my ASP page. E.g. If the IIS Manager's Session Timeout is set to 600 seconds (10 minutes) but in my login ASP page I have Session.Timeout = 20 (20 minutes) then the session will timeout after 20 minutes. Is this correct? Also, what is the IIS Connection Timeout and does it override either of the methods of setting Session Timeout? Regards, Simon. |
|
#2
|
|||
|
|||
|
Two ways to set the TimeOut of a Session.
First is through the IIS Console something like, Open up the IIS console and right click on the site that you wish to change, select properties. Click Home Directory Tab, the Configuration Button, and the App Options Tab. There you will see the enable session state checkbox and the session timeout setting. The second is on a page-basis, at the top of your .asp page simply set it like: Session.Timeout = [intMinutes] Where [intMinutes] represents(in minutes) how long before the Session will Timeout. NOTE: -------------------------------------------- Setting the Session.Timeout inside your .asp pages WILL override the setting in the IIS console. Hope this helps! Sincerely Vlince |
|
#3
|
|||
|
|||
|
Thanks Vlince. That confirms what I thought about ASP overriding the IIS Manager setting for Session Timeout. I'm still not sure about the Connection Timeout though. The IIS Manager help says:
Quote:
How does this differ from the Session Timeout? Regards, Simon. |
|
#4
|
|||
|
|||
|
BEGIN QUOTE--------
How does this differ from the Session Timeout? END QUOTE----------- How does what differ from what? I don't understand the question ![]() Ohhhhh.....ok I get it... The Session.Timeout and the Server.ScriptTimeout are TWO DIFFERENT THINGS. Assuming that a user visits your web site. He then enters a username inside a <textbox>. You then decide to put this username inside a Session variable. The default length of the Session variable is 20 Minutes UNLESS you specifically decide to change that. There are TWO ways to do so like I described in my last post. Now assuming that the user(still connected to your web site) decides to search for something inside your database. He then enters some text inside a <textbox> and clicks the <SEARCH> button. You(the programmer) then connect to your database and try and get a Recordset back...so far so good Now imagine something *IS* happening on the SQL Server and that for some strange reason the Query takes forever to executes. The user will eventually receive a Connection Timeout That means that the length the script was allowed to run for was surpassed and the server then sends a Connection Timeout. This has NOTHING to do with the Session.Timeout in fact they are TWO completely different things. Now, you can set the Connection of a script inside the IIS console, that length *IS* set in seconds. You can override this setting on a page-basis by using the following instruction: <%Server.ScriptTimeout = [intSeconds]%> Where [intSeconds] represent(in Seconds) how long should the script/page wait before it sends a connection Timeout to the user. It is good practice to change/play around with this setting IF you have a Query that will take for ever to load. You might also want to look into the IsClientConnected property Hope this helps! Sincerely Vlince |
|
#5
|
|||
|
|||
|
Cheers Vlince - that's got it straight in my head now!
Many thanks, Simon. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Session and Connection Timeout |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|