最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to get the number of tabs opened of my web in a browser using jquery? - Stack Overflow

programmeradmin1浏览0评论

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.

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.

Share Improve this question edited Oct 19, 2012 at 10:47 Ali Hassan asked Oct 19, 2012 at 10:33 Ali HassanAli Hassan 6071 gold badge11 silver badges24 bronze badges 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 Commented Oct 19, 2012 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 Commented Oct 19, 2012 at 10:48
Add a ment  | 

2 Answers 2

Reset to default 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…

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

发布评论

评论列表(0)

  1. 暂无评论