Streamlit Cloud apps refreshes automatically

Is there anyway we can save session settings locally (to a text file maybe), so even though the app refreshes, it can reload from the saved file & we can set the user session again, without having to worry about the app refresh??