Subscription to update the list of users online

CometServer().subscription("track_online.subscription", function(msg)
{
    // Processing of the event that someone went to the site and subscribed to the channel track_online
});	
CometServer().subscription("track_online.unsubscription", function(msg)
{
    // Handling an event that someone left the site and / or unsubscribed from the track_online channel
});	

Open this page from different browsers and you will see incoming messages from CppComent about other users who opened or closed this page in other devices.

Example:

Discussion

Enter your comment. Wiki syntax is allowed:
C K X V N