What I did was to have an “Event OnSwapPlayerControllers”, Save that to an array of type “Player Controller”.
Then once you have the number of connected players, you could put an EventLogout in your Gamemode that finds the player thats leaving the game using a For Each Loop with Break, then remove that index from the array, send it to the server, and finally Destroy Session on the Game Instance.