Hi @Oliver_Wang, welcome to the forum !
Client-side state is being tracked there but for now on the Streamlit roadmap it’s planned for somewhere around 2020.
In the meantime you can work with the st.cache gist to preserve info between runs. You can check a working example of this here.
Cheers,
Fanilo