I am looking a way to know how many tabs are opened of my web in a browser. Basically my purpose is to handle "keep me logged in" check. But the issue is when I do not checked that checkbox and open multiple tabs then if I close a single tab, It removes my session. I want to know if the user has not checked the "keep me logged in" checkbox and then he closes the last tab of my web then I should destroy his session.
Asked
Active
Viewed 3,534 times
2
-
You may want to just clarify your title to indicate you're only interested in tabs that belong to your site, and not in general. – PhonicUK Oct 19 '12 at 10:40
-
I only require a way to know only about my web tabs not all others tabs opened in a browser. – Ali Hassan Oct 19 '12 at 10:48
2 Answers
4
I guess (and hope) you can't because that would mean you would have access to the users private data – e.g. which URL's he has open in another tab.
What you are trying here is a privacy nightmare to me…

feeela
- 29,399
- 7
- 59
- 71
-
@feela I dont want to get all other tabs I only need to know about my web tabs opened in the user browser so that when he quit the browser and he did not checked the "keep me logged in" checkbox then his session should expire at that time not on each tab close. – Ali Hassan Oct 19 '12 at 10:51
2
You should use cookies to check if you are logged in. You should not get to know what other sites user is seeing or how many other sites he is seeing

Ranjith Ramachandra
- 10,399
- 14
- 59
- 96
-
-
I do not know much about node.js. But you should be able to send a cookie that is different than the cookie you use for normal sign in. On a separate note,, Keep your server side and client side code modular as much as possible. They should speak to each other using clear cut interfaces, but the server should not have to worry about how many tabs the client has and stuff. – Ranjith Ramachandra Oct 19 '12 at 11:12
-
Thanks for your nice information. I will take care of it but I still need to know a way to handle cookies in nodejs. – Ali Hassan Oct 19 '12 at 11:21
-