This is how I would do it.
Craft a cookie that expires, say, in 30 minutes (i.e., a non-persistent
cookie that times out later than a session cookie).
If your Session_start even handler, look for this cookie. If it is present,
then it indicates that user has timed out, but haven't closed the browser.
If the cookie doesn't exist, either it is because the user has not posted
back for 30 mins or the user closed browser (which would remove a
non-persistent cookie).
I guess you just have to determine what is an optimum time for the cookie
expiry time in order to distinguish between time-out vs browser closing.
HTH
"David Laub" <dl***@wheels.com> wrote in message
news:Oc*************@TK2MSFTNGP11.phx.gbl...
Thanks - but that just raises what I guess should have been my REAL
question:
Is there a way of detecting a "real" time out - i.e. the user of the web
app still has a page open in his/her browser, but didn't click a post-back for
20 minutes
versus the user explicitly closed the page/browser
what I specifically want is to display an error page on a time out - but
if just put unconditional code in Session_End, I'll have no way of knowing
what's an error and what isn't.
"CW" <a> wrote in message news:u$*************@TK2MSFTNGP10.phx.gbl... Put your code in the
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
End Sub
handler of the global.asax file.
Same as in the ASP classic.
"David Laub" <dl***@wheels.com> wrote in message
news:ex**************@TK2MSFTNGP12.phx.gbl... Is it possible to know when an asp.net session has timed out? Is
there some sort of timer event?
Thanks