One of the projects I'm working on counts document downloads. Yesterday I was fixing a bug relating to it double counting, but only in IE. The documents can only be pdf or docs. We have .doc, .docx and .pdf files being handled by a DocumentHandler class as set up in web.config
<httpHandlers>
<add verb="*" path="*.pdf" type="DocumentHandler"/>
<add verb="*" path="*.doc" type="DocumentHandler"/>
<add verb="*" path="*.docx" type="DocumentHandler"/>
</httpHandlers>

DocumentHandler has a ProcessRequest method. Within this method we increment our count.

When opening a .pdf by either Firefox or IE this method gets called once.
When opening a .doc or .docx with Firefox this method gets called once.
When opening a .doc or .docx with IE this method gets called twice. Firstly when the browser window is created, and then when the Open dialog is displayed.

I spent some time looking into this, especially concentrating on the differences within the context.Request object. The second time this method is hit, the UserAgent is Microsoft Office Existence Discovery. The other, more usable, difference is that Context.Request.UrlReferrer is null. This is the condition I have chosen to use to prevent the double counting. If someone stores the link to the document as a bookmark, then this won't count, but within the context of this application this is unlikely.