Well, I've seen an application totally buit in CF that shows in the login
Screen how many users are conected to the system, so I thought it was
possible.
So, how do I increment that variable? I mean how do I know if a new session
was started? If I can count the number of sessions, I thought in doing
something like this:
I create a Scheduled template that runs at every 2 minutes eg. , It checks
how many sessions are actived and them set an application var to it. In my
application.cfm I test this var, if its greater than a pre-defined number, I
don't allow anymore users, if don't that's ok.
The problem I found here is, as the template runs every 2 min. Letīs suppose
it check at 14:00 and we had 4 users, suddenly at 14:01 2 users entered at
the same time, and now I have 6 users (I want a maximum of 5) in the next
check 14:02 the template sets my var to 6 and no one else gets in, BUT,
there are 6 users one more than I would allow, what should I do now?
Thanks
Vinicius
-----Mensagem original-----
De: Dave Watts <[EMAIL PROTECTED]>
Para: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Data: Quarta-feira, 3 de Maio de 2000 21:27
Assunto: RE: number of users
>> How do I see how many users are conected to my page? After a user
>> is authenticated via password using session variables, I need to
>> know how many are conected so I can set a maximum number of
>> simultaneous conections. And how will I know when a user leaves?
>
>You could count users by incrementing an application variable when they
>start a session, but you can't really know when a user leaves - you can
only
>know when they've waited long enough between requests that their session
has
>timed out. You could use JavaScript to handle the event that occurs when
>they leave a page, and have your JavaScript routine attempt to communicate
>this back to the server, but that's about the extent of your control.
>
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>voice: (202) 797-5496
>fax: (202) 797-5444
>
>
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.