I\'m sure we\'ve all worked on, or are aware of web applications (especially in the enterprise) that have tightly bound themselves to the server session. In these cases, it
A very simple solution that you may or may not be able to use is have a single page (ie, a single URL such as home.whatever) for the ajax application. If they request that same page a second time and there is already a valid session, then you know they opened a new tab or a new window. Note that you wouldn't be able to distinguish this from a refresh, however.
Your solution is way too complicated.