Solved

ASP Session Checking

Posted on 1999-01-26
4
175 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
ID: 1859209
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
ID: 1859210
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
ID: 1859211
<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
ID: 1859212
Did the above comment work?
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
This code tracks birthdays 3 57
Angular 2 - Issue in page Layout 2 47
REReplaceNoCase help 1 14
Accurate Analytics (Not Google) 2 9
Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
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…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

912 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

17 Experts available now in Live!

Get 1:1 Help Now