You could use cookies and a database. When a user get's to your page, you see the cookie and put an entry in the database with the userid and the current time. Then on each page the user visits that you want to track, it would have to update the time when the page loads. When you want to show how many people are currently looking at your site, you do an query and count all of the entries that are under 5 minutes old. Here's where the stateless part comes in. You'd be assuming that if they didn't visit a new page in 5 minutes, they must of left your site. It should give you an idea, though. You could probably use sessions instead of cookies, too.
Hopefully that gives you an idea...
---John Holmes...