Active users whether using PHP, ASP, ASP.NET, etc. will never be 100% accurate.
The reason for this is that the protocol (HTTP) that you use to connect to a web site is a statless protocol.
This means that each time a page, file, image, etc. is called by your web browser and connection to the server is opened as soon as the page has finshed downloading the connection is dropped and the server no-longer knows if the person is just reading a page or has left the site.
Also for each image on a page a new sepprate connection is made and then dropped to download that image.
So keeping track of who is on the site is more a limitation with the HTTP protocol and how the Internet works.
So the only way to get around this is to use things like cookies and IP addresses to try and keep track of the user and then leave a 10 minute expiry time to incase the user is reading pages inbetween moving around the site. The problem then is that not everyone has cookies enabled also IP address can change, so there is no 100% way of keeping track of a user.
Edited by -boRg-