I save last market session information in a variable.

How can I save it to a file in case of a live server update or shut down?

I need to load it back if there is a saved value.

Thanks