persist state on server and share with client