First, you can't query IE window for tabs that contain a link to your site. To achieve that, you might have to write a service.
As regards multiple logins... on my current project, I wanted something like what Facebook has, list all devices you were logged in on and sign you out from the ones you want. You could port that to your project.
I am using NoSQL so the logic is this...
Create a login session database.
When a user logs in to the server, generate a login key... I use the browser user agent, the username and the IP address like so 199.199.199.*** The last three digits are not used cause of dynamic IP addresses.
Store the Login Key in the DB.
For all logins, the DB looks something like so...
Users: {
"Username1": {
"logins":[
{"agent":"Mozilla 3.2","OS":"Windows 2000","IP":"999.999.999.991","loginKey":"Key1"},
{"agent":"IE8","OS":"Windows XP","IP":"999.999.999.191","loginKey":"Key2"},
{"agent":"Chrome32","OS":"Chrome OS","IP":"999.999.299.391","loginKey":"Key3"}
]
},
"Username2": {
"logins":[
{"agent":"Safari 7","OS":"Mac OS X","IP":"999.399.999.991","loginKey":"Key1"},
{"agent":"Safari","OS":"IPhone 5","IP":"999.199.949.191","loginKey":"Key2"}
]
}
}
When you want to show the user where he is logged in, just display the logins for his account. In your case, you could just check if there is already a session key in the db for the user, inform him and do other things.
Note that using a SQL based db could affect the performance of your website since you'll also need to check if the user visits subsequent pages. Or, you could just do this for when the user logs in only.