first, the phrase "multiple instances of a unique session id" just sounds wrong...🙂
I would create an associative array with the session id's as the keys then on each iteration of the loop check to see if there is a value for that key. Okay, maybe that didn't make sense... let's put it this way:
while(true)
{
// code to put the session id into $session_id here
if($session_check_array["$session_id"] == "")
{
// you know this is the first occurrance of that session_id
// so do what you need to here....
$session_check_array["$session_id"] = 1;
// we put a 1 in the array with the $session_id as the key so that
// if we hit this session_id again, the value will not be NULL and this
// chunk of code will be skipped
}
... that should be a little bit clearer (more clear?).
-frymaster
}