Hi,
There’s no “correct” method as the cookie aspect of your code is not directly related to Cesium. As long as you are retrieving the cookie and setting viewer.scene.mode and viewer.baseLayerPicker.viewModel.selectedImagery to the appropriate values, you’re doing it correctly on the Cesium side.
Thanks,
Gabby