Solved

ASP Session Checking

Posted on 1999-01-26
4
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

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 …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
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…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

710 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