Configuring - General Tab - Keep Connected
Categories: State handling
|
Tags: Architects, Developers, XML, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
Revision:
1
Posted:
05/Oct/2009
Updated:
04/Dec/2010
Status:
Publish
Types: Reference
|
OverviewThis article is a part of articles on Configuring Visual WebGui application General tab
Settings| Keep Connected settings | Default value | web.config | Description |
|---|
| Keep Connected Interval | 120000 | <WebGui>
<KeepConnectedInterval Value="120000" />
<KeepConnectedLimitation Value="0" />
</WebGui>
| Time in milliseconds between KeepConnected requests when application is idle
|
| Keep Connected limitation | 0 | Number of times a KeepConnected request should be sent, until the application times out
|
|
GeneralIn Visual WebGui, to simulate a Windows Forms connected and stateful environment over the web, we have KeepConnected requests sent every two minutes (default), unless changed in the KeepConnectedInterval configuration. These requests are sent indefinately, unless the KeepConnectedLimitation configuration is changed. numerical values placed in the KeepConnectedLimitation configuration state how many KeepConnected requests will be sent to the server by the client before stopping completely, allowing the session to be killed by ASP.NET.
If for example the ASP.NET sessionState timeout setting is set to 2 (minutes) for example and ((KeepConnectedInterval * KeepConnectedLimitation) / 1000) would be larger than 1 (half of 2), if something went wrong, the ASP.NET could kill the session before the first KeepConnected request from the client would arrive at the server.
As a result we suggest the users always have the ((KeepConnectedInterval * KeepConnectedLimitation) / 1000) at most half of the sessionState timout configuration. This also is suggested in much larger time spans.
Keep application alive indefinitelyUsing the recommended settings above, set KeepConnectedLimitation = 0, and then make sure that KeepConnectedInterval is less than half of the sessionState timeout.
Example: KeepConnectedLimitation = 0, sessionState timeout = 20 min, KeepConnectedLimitation = 540000 (9 minutes). In this scenario the default KeepConnectedLimitation = 120000 is also fine.
Timeout session before applicationThis can be useful in authenticating applications with Logon forms, where you want to timeout the application and show the logon form when it times out.
For this purpose, you need to make sure that you get no KeepConnected requests within the sessionState timeout counter period, as the KeepConnected request will reset the sessionState timeout counter. This means that you need to set KeepConnectedInterval to a little greater value than your sessionState timeout.
Example: sessionState Timeout = 5 min, KeepConnectedLimitation = 0 (indefinite) and KeepConnectedInterval = 310000 (5 minutes and 10 seconds).
Timeout application and use redirect on timeoutThis can be useful if you do want your application to time out, and on timeout you want the user redirected to a specific page.
For this purpose, you would be overriding the Timeout Html document via a Theme, and change it to redirect when loaded (that is, on timeout). See the Themes page on how to override this document.
For this purpose you need to activate the KeepConnectedLimitation setting to a non-zero value, which will decide how many KeepConnectedInterval periods will pass before the application is timed out. You also need to make sure that the sessionState timeout is set to a value that is greater than KeepConnectedInterval times (KeepConnectedLimitation + 1), as if you don't, the session will be destroyed before the timeout has been reached, and you will never get a timeout.
Example: KeepConnectedInterval = 60000 (1 minute), KeepConnectedLimitation = 5. This will give you 6 minutes, 7 to be sure, so it should be safe to set sessionState timeout = 10 min, or even keep it at the default 20.
ReferencesForum ThreadsIssuesOther references
About the author
Related Articles
|
State handling
|
|
|
Tags:
Developers, Navigation, 2. Intermediate, 3. Advanced, ASP.NET, Pre v6.3, v6.3, v6.4 and Later
|
|
|
This article explains how to configure a Visual WebGui application to work without using cookies.
Tags:
Developers, XML, 1. Beginner, 2. Intermediate, 3. Advanced, ASP.NET, Pre v6.3, v6.3, v6.4 and Later
|
|
|
Tags:
Architects, Developers, XML, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
|
|
|