Server: when session is found, close it before erasing
When erasing it would still leave the connection hanging because as far as the client is concerned, its just temporarily disconnected. This actually tells the client that we are now closing the session.
Edited by Akseli Lahtinen