Save and restore content in local storage.