Re: Total Server Sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> $num_sessions = count(glob(session_save_path() . '/sess_*'));
> echo "There are about {$num_sessions} active sessions.";
> 
> It will be fairly active so long as your garbage collection is triggered 
> fairly often.

it is worth noting that this doesn't work if you are using the recursive
directory structure method to store sessions, or any other session
storage method other than the default (in-memory sessions, database
sessions, etc).  and on a shared host, you may be counting the total
number of sessions for all the virtual hosts on the server. also, on a
shared host, it is usually up the sysadmins how PHP stores sessions, so
your mileage may vary.

/jw

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux