Managing /tmp files when there are multiple users using the app at the same time

Hey @zacheism - there’s currently nothing in the public Streamlit API that can distinguish between multiple “user sessions”.

However! See this thread and associated Gist where @thiago demonstrates a method for creating a session ID.

If you don’t mind the hackiness, you could use the code from the Gist to create your user-specific temp files at e.g. "/tmp/%s" % get_session_id().

1 Like