ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 29th, 2003, 06:14 AM
SiPeaPod SiPeaPod is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Watford, England
Posts: 6 SiPeaPod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old July 29th, 2003, 07:08 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old July 29th, 2003, 07:22 AM
SiPeaPod SiPeaPod is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Watford, England
Posts: 6 SiPeaPod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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:
Connection Timeout

Sets the length of time in seconds before the server disconnects an inactive user. This ensures that all connections are closed if the HTTP protocol fails to close a connection.


How does this differ from the Session Timeout?

Regards,
Simon.

Reply With Quote
  #4  
Old July 29th, 2003, 07:46 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #5  
Old July 29th, 2003, 08:36 AM
SiPeaPod SiPeaPod is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Watford, England
Posts: 6 SiPeaPod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cheers Vlince - that's got it straight in my head now!

Many thanks,
Simon.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Session and Connection Timeout


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway