Re: Total Server Sessions
| From: | John Holmes | Date: | Mon, 03 Jan 2005 16:57:00 +0000 |
| Subject: | Re: Total Server Sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-205533@lists.php.net to get a copy of this message | ||
HarryG wrote:
Is there an easier way to count the total number of sessions running on a PHP webserver? something like session_count(); I've seen some php site where it tells you how many people are currently online, which I guess is being done by keeping a count of total sessions running on the server$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. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com