Hi all, I want to count number of visitors currently viewing my website. To do this i have created a global variable count and increment on each page request. But how do i know a visitor leaves my site so that I can decrement count variable by 1. Thank you
Practically speaking, you cannot know when a user leaves your site. Most sites that have a "current visitors" number are actually reporting the number of visitors within the last X minutes, where X is some arbitrary number.