Re: Do IIS applications "go to sleep"?



One thing to remember is web applications are designed to be stateless. The
idea is there is a request from a client (generally a browser) and a
response from the server. To fake a session, a server cookie is set on the
client side. This type of cookie is not disabled when one disables client
cookies, so do not think of this as your typical cookie, except that both
send their information with every request. State is an illusion created by
using these session items (like a server cookie).

Now that you have that down, consider what happens to sessions that do not
need your timer when you extend a session timeout to five days. Everyone who
hits the application takes up memory for five days, or until the application
dies.

If you need a timer to run, you are better to set up a windows service that
will handle the timer. You can fire it off from your web application, if you
would like, but consider it a one way trip.

Short answer: You can configure this "timer" to stay up longer, but you may
end up with some bad effects.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"Rob" <rob_nicholson@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:zusLi.43650$Db6.16766@xxxxxxxxxxxxxxxxxxxxxxx
In a previous thread, I was asking about setting up my global.aspx which
inherits System.Web.HttpApplication. This is where there are the event
handlers like:

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

In this file I've got:

Private WithEvents ApplicationTimer As System.Timers.Timer ' used to
generate application events

and the associated:

Private Sub ApplicationTimer_Elapsed(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs) Handles ApplicationTimer.Elapsed

This works fine but for some reason, the timer stopped running after a
while. I had left the application idle on the web server. Do application
events continue to run forever even after all sessions on the webapp have
timed out/finished?

Cheers, Rob.




.



Relevant Pages

  • Re: Threading - Is this Ok?
    ... panel using a Timer control. ... So client will not see any progress. ... requests to server to refresh progress. ... I think you can put Status into Session state and pass Session to a ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Do some operation just before sending response header
    ... If I want to change PHP session mechanism to store session data into ... you are allowing the client unrestricted access to modify the ... creating a cookie first) but it's a really bad idea to push the ... is it possible to hook before sending response header? ...
    (comp.lang.php)
  • Re: Threading - Is this Ok?
    ... panel using a Timer control. ... So client will not see any progress. ... requests to server to refresh progress. ... I think you can put Status into Session state and pass Session to a ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Wont save session object
    ... client machine's cookie setting. ... the ASP.NET's session is by default associated with all the client ... something incorrect with the client's cookie setting. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Threading - Is this Ok?
    ... panel using a Timer control. ... So client will not see any progress. ... requests to server to refresh progress. ... I think you can put Status into Session state and pass Session to a ...
    (microsoft.public.dotnet.languages.csharp)

Loading