By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,796 Members | 1,240 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,796 IT Pros & Developers. It's quick & easy.

Log when users sign in/end session

P: n/a
In my asp.net app I'm logging whenever someone signs in through the login
page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hey there,

I forget the code, its late so pardon my vagueness, but there is Javascript
code that will let you popup another popup window on browser close, you
could probably get away with doing something like that, then in the page you
popup, run your code that says "Hey, im quitting my session"

hth,

Todd

"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:uK**************@TK2MSFTNGP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login
page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks

Nov 18 '05 #2

P: n/a
You can attempt to do this either through a dedicated signout page, or you
can try to do it through the Session's OnEnd event. Be aware though, the
OnEnd event is primarily for garbage collection and doesn't handle the
creation of certain objects. You can't do anything when a user closes a
browser, because you never know when they close a browser since the user is
disconnected the millisecond they stop receiving the requested web page and
files.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:uK**************@TK2MSFTNGP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login
page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks

Nov 18 '05 #3

P: n/a
Thanks guys. I ended up using Session_End in Global.asax.

Take care...

"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:eO**************@TK2MSFTNGP10.phx.gbl...
You can attempt to do this either through a dedicated signout page, or you
can try to do it through the Session's OnEnd event. Be aware though, the
OnEnd event is primarily for garbage collection and doesn't handle the
creation of certain objects. You can't do anything when a user closes a
browser, because you never know when they close a browser since the user is disconnected the millisecond they stop receiving the requested web page and files.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:uK**************@TK2MSFTNGP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks


Nov 18 '05 #4

P: n/a
That's what I'd do: use Session_End. But, know that it doesn't fire when
they close the browser...only after the app eventually gives up on the
session (20 minutes by default), or you call session.abandon, etc. It also is
only good if SessionStateMode is "inproc" (the default). Finally, there's a
response.isclientconnected property out there. Never used it...not sure if it
more accurately determines that a session has ended (I don't think so).
Anyway, Session_End is as good as any I know of.

Bill

"VB Programmer" wrote:
Thanks guys. I ended up using Session_End in Global.asax.

Take care...

"Mark Fitzpatrick" <ma******@fitzme.com> wrote in message
news:eO**************@TK2MSFTNGP10.phx.gbl...
You can attempt to do this either through a dedicated signout page, or you
can try to do it through the Session's OnEnd event. Be aware though, the
OnEnd event is primarily for garbage collection and doesn't handle the
creation of certain objects. You can't do anything when a user closes a
browser, because you never know when they close a browser since the user

is
disconnected the millisecond they stop receiving the requested web page

and
files.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"VB Programmer" <Do*****************@jEmail.com> wrote in message
news:uK**************@TK2MSFTNGP15.phx.gbl...
In my asp.net app I'm logging whenever someone signs in through the login page successfully. How do I log when they've "gone away", whether by
closing the browser, the session vars for a person has expired, etc...?

Thanks



Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.