Streamlit Auto Refresh issue and state loading

I am trying to use streamlit for my ai chat bot system but I observed that while an interactive session between user and bot the streamlit screen get’s refresh and the chat are lost.
It is very annoying a lot of time.
Can someone plese tell me how to solve it , this autorefresh happen in 30 min to 1 hr. Once it happen then in 1-2 min again happened

also in streamlit we are facing an issue of state loading. we need to rerun everytime to change state.
Any update from streamlit team when this feature will be added

Can you share your code?

Sorry I can’t

Same issue in firebase studio on android. One of my devices refreshes every time. Another one randomly but it’s usable although refreshes near the ned of a project right when we are nearly finished. Extremely frustrating since android is already hard enough to use in firebase studio