#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    Sydney
    Posts
    33
    Rep Power
    12

    Application object


    My asp application allows a number of users to log into it. Each user has a different type of access level (General User, Manager or Administrator). I want the administrator to be able to see how many other users are logged into the application at a particular time. How can I do this?????

    Would the use of an application object work for this???
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    NJ
    Posts
    428
    Rep Power
    17
    As long as you have sessions enabled, it is quite easy.

    In your global.asa file:
    PHP Code:
    Sub Application_onStart
      Application
    ("Count") = 
    End Sub
     

    Sub Session_onStart
        Application
    ("Count") = Application("Count") + 1
    end sub 

    Sub Sesion_onEnd
       Application
    ("Count") = Applcation("Count") - 1
    end Sub 
    you can then get the value of the people connected by reading the Application("Count") variable. This of course assumes that to access any part of your site you have to log in.

IMN logo majestic logo threadwatch logo seochat tools logo