Get User / Session Id

Hi Streamliters :slight_smile:

I am looking for a way to attribute/extract a unique ID for each user using an app hosted in Azure.

I’d like to get the same type of stats as what applications hosted in Streamlit Cloud allow:

I guess it could be something like “st.user_id()” (Streamlit issuing a unique ID) which we could extract and log.

Is there such a function existing? (I’ve not found it in the doc or in the forum so far…)


Hi @pierrelouisbescond,

Thanks for posting!

Streamlit does not have an API like st.user_id but you could use other workaround methods to achieve your goal. You could connect your app to Google Analytics and get some logs that way. This thread would be a great place to start implementing some of the solutions.
Here’s another approach on StackOverflow.

Thanks. I’ll explore the IP logging that might be easier than the G Analytics integration!

1 Like

Awesome! Let us know if you find a working solution or if you have any other questions.

Happy Streamlit-ing! :balloon:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.