Using Global.asa to determine users LOGGED IN to s

Results 1 to 2 of 2

Thread: Using Global.asa to determine users LOGGED IN to s

  1. #1
    Join Date
    Dec 1969

    Default Using Global.asa to determine users LOGGED IN to s

    I am creating a membership site and I would like to determine how many users are logged into my site at any given time. I don&#039;t want to know how many users are on my site, since people can access parts of the site without having to log in. I only want to know how many are currently logged in.<BR><BR>I am using a SQL Server 7.0 database for the backend. I know that if I really wanted to, I could have the login process increment a single value in the database and decrement it during the logoff process. However, I would like to limit database access as much as possible, since the rest of the site needs as much of the database&#039;s resources as possible. Plus, I would have to jump through hoops to get the database to decrement that value when the user simply closes their window instead of logging out.<BR><BR>Currently I am using an application variable located in the Global.asa file that increments every time a session starts and decrements every time a session ends...but, it is including every connection to my website (even pre-logged-in connections), since the Global.asa file must reside in the root directory of the website. (i.e. inetpub/wwwroot).<BR><BR>Also, the login process consists of setting a session variable equal to &#039;True&#039; if the user&#039;s username and password are validated. (Usernames and passwords are stored in the database, of course...) Every page that only logged-in users can have access to are protected by a small script that first checks to see if this session variable is true...if it isn&#039;t true it redirects them to the login screen.<BR><BR>Can anyone help me?<BR><BR>Thank you!<BR>---Justin

  2. #2
    Join Date
    Dec 1969

    Default Possible solution...

    increment your application variable everytime someone logs on... Make some type of session variable that says they are logged on... And as soon as the session ends decrement the application variable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts