I recommend that you add this to you global.asa file...
sub session_OnStart
application("usersOn" = application("usersOn" + 1
end sub
sub session_OnEnd
application("usersOn" = application("usersOn" - 1
end sub
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
Thanks, I hadn't heard of anything like that before, but you never know. Probably what would be better is just make a "LoggedIn" table in the db and write session data there when someone logs in and delete when session ends..
Why use a table and the additional overhead when an application variable can hold the data easily?
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
I'm not simply counting the number of users that are logged in. I have multiple customers loggin in from different locations and need to track the number of users from each location as part of a licensing scheme.
So.. when a person logs in from Customer A, they get a session("CustomerId" = "A", Customer B gets a session("CustomerId" = "B", and so on. I need to be able to count the number of Customer A's that are on the system at a given time to limit their number of logins to whatever their license number is.
if session("customerId" <> "" then
application(session("CustomerId") = application(session("CustomerId") - 1
end if
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.