----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Danny Shepherd" <[EMAIL PROTECTED]>
Sent: Tuesday, July 30, 2002 11:52 AM
Subject: Re: [PHP] Sessions - Informed Opinions

> > > >     3 How can I get a count of currently active (I.e non expired)
> > sessions?
> > >
> > > Count the number of session files.
> > Can I be sure that the count will only include active sessions though?
> By definition, if the session file is there, it is an active session.
> There is no such thing as counting active users on the Web.  You define a
> time window and count how many users accessed your site within that
> window.  Once a session has been idle for a time > than the configured
> session gc time, it will get deleted.  I tend to do this out of band
> though.  PHP has a mechanism for calling the session gc code, but I prefer
> to turn this off and run my own cron job that does this regularly.  And
> yes, this is easier to manage if you have a database where you can do a
> simple count() query to get the number of active sessions.

Right, db sessions seem to be the way for me, thanks Rasmus. (Oh, thanks for
PHP too :)


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to