I am implementing a streamlit Chatbot where I have to save the chat log state as a file.
(Could not save a state as a variable since every time, user input a new chat, streamlit will re-run all codes from the beginning, so the variable always got reset )
My questions are:
how can I get a unique user-connection ID?
e.g. when user-A connect, he will get a chat-log file-A , and when user-B connect, she will get a chatlog file-B .
Is there a way to know if the connection is close for like 30 minutes ? (similar to Colab), so that I can delete the chatlog of that user