Write active client to session to persist tree expansion across requests