Reputation: 45
Say there are 5 open tabs in a single browser, and I am using Node.js and Socket.io. The client and server exchange packets to maintain (establish) communications.
Will connection with the client be lost if of one tab is closed?
How can I determine if the user closed the browser?
Upvotes: 2
Views: 378
Reputation: 176
Yes, socket.io establishes a new connection with every tab. You're going to want to look into using session cookies to figure out which user the current socket.io connection is communicating with.
Upvotes: 2