Clean up client session code