First of all, setting Session Timeout to 4 hours is not a business
requirement. A business requirement is defined as what the application
should do, not how it should do it; how it should do it is called "design,"
"architecture," or a "solution."
Second, as design, architecture, or a solution, it is a very bad idea.
You're trying to do something with Session that Session is not designed to
do. Sessions time out to prevent memory resources on the server from being
wasted. When a Session is created, memory is allocated to that Session.
Since it is not known when the user will stop making requests to the server,
the Session automatically times out after an interval in order to free up
the memory allocated. By setting Sessions to time out after 4 hours, you
ensure that every user that logs on the the application will have memory
allocated for a period of 4 hours, regardless of how long the user is using
the application. In fact, the 4 hour interval doesn't start until the last
request is sent to the server. So, if a user goes away from his/her computer
for 3 hours and comes back to access the application, the Session is reset,
assuming that the user hasn't shut down his/her browser, in which case a new
4-hour Session is started.
There are other problems with this solution as well. While the server may
allocate Session memory for 4 hours, that doesn't stop the client from
closing the browser window and opening another. Depending upon the actual
business requirements for which this solution was proposed, there may be
serious security issues as well.
Your web application may be recycling due to excessive memory usage. If the
amount of memory being consumed by a web application reaches a certain
critical point, this will happen automatically.
There are any number of better solutions to satisfy the (as yet unnamed)
business requirement for which this ill-advised solution was devised. Just
about any of them would be better for you. If you can share with us the
actual business requirement, that would be a good starting point.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net