Re: Total Server Sessions

From: Date: Mon, 03 Jan 2005 17:28:16 +0000
Subject: Re: Total Server Sessions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-205540@lists.php.net to get a copy of this message
> $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

« previous php.general (#205540) next »