Sessions and Viewers
Posted: Thu Jul 03, 2008 8:18 am
I'm trying to write a little functions that would display the number of concurrent sessions. This site does it with the number of "Guests" but I'm not sure where to begin.
Logically this is how I'm thinking of coding it (pseudo code)
I thought of using the IP just because of it's unique characteristic, there's got to be a better way to do it.
I know that will only work for each session which would return just 1. Is there a tutorial or something out there someone can share? Thanks guys.
Logically this is how I'm thinking of coding it (pseudo code)
Code: Select all
function foo(){
$IP = $_SERVER['REMOTE_ADDR'];
$_SESSION['IP'] = $IP;
$result = count($_SESSION['IP']);
return $result;
}
foo();I know that will only work for each session which would return just 1. Is there a tutorial or something out there someone can share? Thanks guys.