Inactivity Time out

Hello, am new to Streamlit and am building a chat bot.
I was wondering if anyone has experience implementing an inactivity timeout in a Streamlit app. I am thinking in setting a time in st.session with every action; and use that to check when the inactivity reaches the inactivity limit.