EDITED: I don't want to logout all opened tabs, I just wan't to keep on the database that the user is still online until he closes all tabs-windows of his session or hit the logout button.推荐答案这是上一篇堆栈溢出的帖子:This is from a previous stack overflow post:if (+Cookies.get('tabs') > 0) alert('Already open!');else Cookies.set('tabs', 0);Cookies.set('tabs', +Cookies.get('tabs') + 1);window.onunload = function () { Cookies.set('tabs', +Cookies.get('tabs') - 1);};网址:如何知道浏览器标签是否已经打开使用Javascript?这应该对你有用!*这不是我的代码,只是传递信息!*This is not my code, just passing on information! 这篇关于在 Web 应用程序中检测同一会话的多个选项卡或窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 11:06