[thelist] asp and viewing client sessions. .

Luther, Ron Ron.Luther at compaq.com
Thu Jan 24 07:39:22 CST 2002


Hi Athena,


My guess is that other folks may be aware of some bug or conditional
problem that makes the following 'not a good idea' for a business
critical application.

However, .... for just putzing around ... there was an example I
remember playing with in an old ASP book a couple years ago.

The code can be found here:

http://www.wrox.com/Books/Book_down.asp?sub_section=1&isbn=1861001347&su
bject=ASP&subject_id=28

Warning - this is a 1.55Mb download of example files to go along with
the "Beginning Active Server Pages 2.0" WROX book. (A pretty good book
that helped me {along with folks on the list} get going in ASP.) Inside
the zip file there is a  'Chapter 9' subdirectory.  In there you will
find [Global.asa] and [VisitorCount.asp] files to read through and play
with.

Basically you create a application variable in your global.asa that you
increment and decrement as you start and end sessions. (Don't forget
your locking as you update these values.) 

[My guess is that the "Session_OnEnd" may not be 100% reliable - I think
I remember hearing about issues with the "Application_OnEnd" getting
fooled once in a while ... maybe that's what makes this technique
'suspect' for important work. <shrug>]

In very small testing with two machines hitting a third as a server - it
seemed to work okay for me ... quite a while ago.

Anyway ... it should get you started!

Have Fun,


RonL.


-----Original Message-----
From: Anthony Baratta [mailto:Anthony at Baratta.com]
Subject: Re: [thelist] asp and viewing client sessions. .


At 08:45 PM 1/23/2002, Athena Janiszewski wrote:

>I thought of doing something today in asp and realized I had no clue
how to
>do it, ... I'd like to embed a script in one of the administrative
pages that
>displays how many people are currently logged in at any given time.

Ah, the Holy Grail of ASP coding. Under performance monitor there is an 
option to show number of Sessions. And I remember reading the
Performance 
Monitor or the COM Objects it talks to are available to ASP. So I would 
think that this is possible. Never had the time to try.





More information about the thelist mailing list