View Full Version : Who is Online???

10-25-2007, 06:56 PM
i need to view a list of logged in users...
now i got login\logout thing going on...but if the user will not logout he will be still logged on for the system...
the only rule i want (on this code that i don't know how to wrote) is how to set timeout of 1 hour...that id the user had not moved or did nothing for 1 hour he automaticly will be offline for the system...

10-25-2007, 07:14 PM
You can use the global.asa to get the user's status and have the events when the user joins a website and leaves it.

Sub Application_OnStart
Application("user_count") = 0
End Sub

Sub Session_OnStart
Application("user_count") = Application("user_count") + 1
End Sub

Sub Session_OnEnd
Application("user_count") = Application("user_count") - 1
'Search for the username inside the Users array and remove it.
End Sub

After login
'Add a new user to the Users array
Dim Users()
ReDim Users(UBound(Users))
Users(UBound(Users)-1) = newUserName

10-25-2007, 08:22 PM
the users got to login username+password and than they get some, for example session("login")="true"
do i need to run appliaction too? if i do then how?

can you explain me how this code works?

i never used global.asa before

10-25-2007, 09:10 PM
some thing like this maybe???? :confused:

Sub Session_OnStart
dim conn, rs
if Session("USERNAME")<>"" then
rs.Open "Members where Username='" & Session("USERNAME")
end if
End Sub

can i add includes into asa file?

do i need?

10-27-2007, 03:59 PM
Here: http://w3schools.com/asp/asp_globalasa.asp
This might help you.

10-29-2007, 07:29 PM
barrman you forgot to tell me that Session_OnEnd never shoots...i cannot use Session_Onstart cause the asa runs first and you cannot read any info about the user before of the asa...=>you cannot separate between the users

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum