How to automatically log out user when browser closes?

别等时光非礼了梦想. 提交于 2019-12-22 14:07:18

问题


I have a chat program, which relies on whether the user is online or not to keep chatting. So I was wondering, is there a way to logout the user when he/she closes the WHOLE browser, not just the one window in like say, Safari, IE or Google Chrome?


回答1:


There's nothing available via JavaScript which can be used to detect "WHOLE browser" exits. If you need to be notified when a browser has completely exited (even defining this would be non-simplistic), consider developing browser extensions.




回答2:


My browser is google chrome. i have a idea:setttings-the last settings(more settings-the last)--to logout the user when he/she closes the browser,like cookies and so on.



来源:https://stackoverflow.com/questions/10116292/how-to-automatically-log-out-user-when-browser-closes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!