Solved

ASP Session Checking

Posted on 1999-01-26
4
172 Views
Last Modified: 2013-12-25
From an administration screen I want to be able to see a list off all current sessions. I do not need to see any of the session variables (but am interested if this can be done). I just want to know if session xxxxxxx is still active.
0
Comment
Question by:julesuk
  • 2
4 Comments
 
LVL 28

Expert Comment

by:sybe
Comment Utility
Give every user an Application variable. They work the same as Session variables (so they time out at the same time) and are shared among all users. Make a "secret page" which will display all current application variables.
0
 

Author Comment

by:julesuk
Comment Utility
How does this work if the number of users grows? Does the user list have to be a constant for this to work, eg. setup 100 variables to support 100 users? Could you please provide a sample of the code required to do this, i.e. both setting up the application variable and also how to list all current application variables.
0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
<script language=VBScript runat=Server>
Sub Application_OnStart
      Application("WhoOn") = 0
End Sub

Sub Application_OnEnd

End Sub

Sub Session_OnStart
      Session.Timeout = 20

      Application.Lock
            Application("WhoOn") = Application("WhoOn") + 1
      Application.Unlock
End Sub

Sub Session_OnEnd
      Application.Lock
            Application("WhoOn") = Application("WhoOn") - 1
      Application.Unlock
End Sub
</script>


Then in a page, use:

<%=Applicaiton("WhoOn") %> to get the number of concurrent users.

0
 
LVL 10

Accepted Solution

by:
MasseyM earned 100 total points
Comment Utility
Did the above comment work?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now