Re: Counting number of users logged in

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



re:
!> how do I capture which users have just closed the browser window

You can't, unless you're using the Membership class for logins.

re:
!> those who have left the browser open

You can't.

re:
!> whose session has timed out?

You *can*, by capturing the Session_OnEnd events, but only if you're using InProc
session state management and relying on counting the number of sessions active.

If you're using SQL Server session state management or State Server,
the Session_OnEnd event ( also referred to as Session_End ) will never fire.

So, at most, you can keep track of how many sessions are active,
but not how many users are actually connected, if you rely on counting active sessions.

Btw, you didn't say whether you're using the Membership class for logins, but if you are,
you can trap the number of users logged in with Membership.GetNumberOfUsersOnline().

Simple, huh ? ...but it only works if you're using logins and Membership.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Mike P" <mike.parr@xxxxxxxxx> wrote in message news:%23z0mfzT8HHA.5424@xxxxxxxxxxxxxxxxxxxxxxx
That is the thing I don't know how to do....I can capture which users
have clicked on a Logoff link, but how do I capture which users have
just closed the browser window, or those who have left the browser open
and whose session has timed out?

*** Sent via Developersdex http://www.developersdex.com ***


.



Relevant Pages

  • Re: Sessions and closing the browser
    ... >> OTOH if the user logs in then opens up a new browser window and logs ... >> cookie therefore the same session data. ... The fact that they allowed multiple logins using the same username does not ...
    (comp.lang.php)
  • Re: Attempt to de-mystify AJAX
    ... our shopping cart cookies are ... >> the session from the temp files and the cookie will automatically expire ... > the session key is valid (inactivity time limit not reached). ... > What will happen, however, is that if the browser window goes away, the ...
    (comp.databases.pick)
  • Session lost after showModalDialog or showModelessDialog
    ... All three forms write out the session id the browser window and that the ... Form2 writes out the session id and has a html button which opens Form 3 ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Session data overwritten when using two browser instances (CTR+N)
    ... The culprint is the way the second browser window is opened. ... share session variables and when the user change event in browser window no ... the session variables is changed also for browser window no 1. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Invalid session when a new IE window is opened using window.open()
    ... browser window using javascript's window.open. ... SessionTimeOut exception invalidating the session. ... opens a IE window but not a IE process and thus carries the same ...
    (microsoft.public.inetserver.asp.general)