I had a similar problem. I got around this by timestamping every visitor and updating every page or every 30 seconds. Then do a simply query and check for equal times matches within 30seconds. This is the only way to real count active sessions and visitors.