Control what's happening when a client loses its connection to a server?

How can I control what’s happening when a client loses its connection to a server? E.g. if the host crash or just turns off the game when there still are clients on the server. If there is a session also, must this be reset or removed somehow? More documentation is needed on this topic.