I'm not sure about this. You think of perfect solutions, when most people will settle for simpler solution, that may not be perfect. I imagine a line in the model, that updates a datetime field, every time a user does something in the website, and then finding out who had his last activity in the last 5 minutes.
--