Is there a way to detect when a client disconnects from a meteor server, either by refreshing or navigating away from the page, so that the server can attempt some cleanup?<
I think better way is to catch socket close event in publish function.
Meteor.publish("your_collection", function() {
this.session.socket.on("close", function() { /*do your thing*/});
}
UPDATE:
Newer version of meteor uses _session like this:
this._session.socket.on("close", function() { /*do your thing*/});