|
Posted by William Lovaton on 01/06/05 17:39
Additionally you can check the access time to see which of those
sessions has been accessed in the last, let's say, 10 minutes or
something.
But there are several problems with this. Relying on session files is
not good enough, they might be stored in a database or in shared memory.
Other problem is that those sessions are for every PHP app installed in
the server so you are counting sessions for different apps like it were
from yours.
To solve this you could put some APPID in the session and check for its
value reading the sess file as text. Obviously you will have to figure
out the format a little bit.
-William
El lun, 03-01-2005 a las 08:25 -0700, Rob Adams escribió:
> "HarryG" <harry1980@gmail.com> wrote in message
> news:20050103120421.74985.qmail@pb1.pair.com...
> > Is there an easier way to count the total number of sessions running on a
> > PHP webserver? something like session_count();
>
> If you're using file based sessions, you could count the number of files in
> the directory where the sessions get saved. If there are files in there
> other than just session files, you'll have to look for just the session
> files. On all my systems, they've started with "sess."
>
> -- Rob
>
Navigation:
[Reply to this message]
|