Click to See Complete Forum and Search --> : Sub Session_OnEnd


lmf232s
08-11-2004, 04:51 PM
Question about
Sub Session_OnEnd

End sub

I think i need someone to explain this for me.
I am trying to keep track of active users on the intranet.

so in the
sub session_onStart
application.lock
Application("ActiveUser") = Application("ActiveUser") + 1
application.unlock
end sub

I create a applicatoin variable to track active users.
in the sub session_onend i am subtracting 1 from the activeuser variable but it does not reflect the change.

When does session_onend fire.
I thought it would fire if i close the browser or if i left the site. But this does not seem to be the case because the application varibale it not reflecting that users are logging off.

CardboardHammer
08-11-2004, 04:55 PM
Sessions end when killed programatically or when they time out.

lmf232s
08-11-2004, 04:58 PM
so if i click the X in the upper right hand corner of the browser, it will not fire.

I have explicitly kill the session with like a button for log off, or if the session just times out.

CardboardHammer
08-11-2004, 05:20 PM
That is correct.

You can hack together ways of considering the user inactive before a session expires (say, consider them inactive after a minute, but only expire their session after 20 min.), but it would be more complicated... and likely not really worth the trouble.