Is it possible to get the ids of the users running a given Streamlit service? and send a content to that specific user.
Best
Is it possible to get the ids of the users running a given Streamlit service? and send a content to that specific user.
Best
I think this would be a nice addition if something like this would be possible.
Could for example be used to save information of a user to disks, and to return that specific information from disk back to the user. For example a user uploads images, the app detects objects in the images and lets the user download the results.
Hi @Poyita_de_troya, welcome to the Streamlit community! What would the id represent, something that the user passes in?
Hi! Thanks. Ideally, the user doesn’t need to “register” to any website with some credentials. Simply, 1) streamlit is running 2) a user connects to the URL (assume public IP) 3) the “server” receives a unique id from the user (the user doesn’t setup any id) 4) in a given moment, the server sends information to that specific user.
Is it possible? Or should I create some database tracking each id with a user? I appreciate any advise.
Hey @Poyita_de_troya!
I think the best way to do this would be to create a custom component, which sets a unique ID as a cookie in the user’s browser. If the user is coming back, you can read that cookie and look up if that ID already exists. I once tried hacking something like that together, which kind of worked (even though it didn’t work on Streamlit Sharing). The docs on writing custom components are here and you can build it off this template. To set cookies from the template, you can use this library.
It’s a bit complicated (as components require Javascript) but definitely possible! If you don’t need it instantly I could also have a look at my old code during the next days and see if I can share something with you.
Great! I’ll take a look on it. No, I’m not in a hurry, then, it would be awesome your help.
Thanks
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.