Is there a way to count the number of active sessions on a server?

it would be nice to have something like:
"Right now there are $sessioncount visitors in thÝs site"