Zerium
Zerium

Reputation: 17333

How to automatically log out user when browser closes?

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?

Upvotes: 2

Views: 1985

Answers (2)

jptiancai
jptiancai

Reputation: 23

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.

Upvotes: 1

Ken Browning
Ken Browning

Reputation: 29091

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.

Upvotes: 2

Related Questions