Solved

ASP Session Checking

Posted on 1999-01-26
4
179 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
stop navigation from wrapping 7 80
Grunt Copy file to another destination. 1 37
move widget title down 4 19
keyword rich ebay title, description 2 36
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

773 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