Date: 08/22/01
- Next message: Kristian Koehntopp: "Re: [phplib] current users?"
- Previous message: Michael Chaney: "Re: [phplib] current users?"
- In reply to: tps <email protected>: "Re: [phplib] current users?"
- Next in thread: Kristian Koehntopp: "Re: [phplib] current users?"
- Reply: Kristian Koehntopp: "Re: [phplib] current users?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Due to the stateless nature of http, this is dodgy at best. You
understand this, and you need to educate your client on the nature of
http and its limitations. Suppose that I am browsing an online store
and the phone rings. I talk for fifteen minutes and my session
expires and I lose everything in my basket. If you have files for
download, and users on dial-up modems, it is completely possible for a
session to time out before the transfer has completed! I'd be irritated
if this were me. The truth is that it is impossible to see who is
"currently online," and you should explain why. You can offer to make
is a page that refreshes every so often that queries active sessions
table for the users that have authenticated in the past XXX minutes.
This is as good as it gets.
On Tuesday, August 21, 2001, at 07:14 PM, tps <email protected> wrote:
> On Tue, Aug 21, 2001 at 09:09:09PM -0500, Michael Chaney wrote:
>> On Tue, Aug 21, 2001 at 09:33:36PM -0400, tps <email protected> wrote:
>>> Hi folks.
>>> I've been beating my few brains out trying to figure out how to
>>> tell how many users, and who they are, have active sessions. This
>>> looks to be straight forward, but I must not be much of a programmer
>>> since I can't figure out how to do this. Anyone have a pointer, or
>>> code
>>> snipet?
>>
>> How do you define an active user? Think about that. If you want to
>> know how many people have brought up a page in the last 15 minutes, you
>> can do that easily with a query (this is MySQL):
>>
>> select count(*) from active_sessions
>> where changed>=date_format(now()-interval 15 minute,'%Y%m%d%H%I%S')
>> and name='CE_Session';
>>
>> You can easily use something like that to remove the inactive sessions
>> via a simple cron job every 15 minutes or so, and alleviate the problem
>> of "garbage collection" in your web application.
>
> This much I have. I'm sorry. I wasn't clear enough. I have a site I'm
> building that requires authenticated access. This is working fine. I was
> asked if I can show how many people are using the site at any time. I
> can
> get that from the active sesions. Great. Now they want to be able to see
> from an admin screen that auto-refreshes every 2 minutes, who is
> authenticated
> to the site.
>
> Does that explain a little more what I'm looking for?
>
> Thanks,
> Tim
>
> --
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <
>>> Tim Sailer (at home) >< Coastal Internet,
>>> Inc. <<
>>> Network and Systems Operations >< PO Box
>>> 671 <<
>>> http://www.buoy.com >< Ridge, NY
>>> 11961 <<
>>> tps <email protected>/tps <email protected> >< (631)
>>> 924-3728 <<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <
>
> --
> Abbestellen mit Mail an: phplib-unsubscribe <email protected>
> Kommandoliste mit Mail an: phplib-help <email protected>
>
-- Abbestellen mit Mail an: phplib-unsubscribe <email protected> Kommandoliste mit Mail an: phplib-help <email protected>
- Next message: Kristian Koehntopp: "Re: [phplib] current users?"
- Previous message: Michael Chaney: "Re: [phplib] current users?"
- In reply to: tps <email protected>: "Re: [phplib] current users?"
- Next in thread: Kristian Koehntopp: "Re: [phplib] current users?"
- Reply: Kristian Koehntopp: "Re: [phplib] current users?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

