The server needs to run first. If the client starts before the server, the session is lost (you have to restart the client).