It sounds more like an issue on server side where you should handle something like a timeout for a connection.
If the account hasn't been accessed for X time, then pass the account to "not connected".
To be honest, this is out of the scope of C2 as, as mentioned, this is more server side.
On C2's end, as the tab/browser is closed there is no way to handle this behavior.
If the player does voluntary logout from a "logout" button in your game though, you should be able to handle this through AJAX.