Persisting device fingerprint specific states specific to a client

Though there are ways to store a single sessionā€™s states (like this), there currently seems to be no way to persist them across refreshes for a single user/client. (Something roughly like a browser cookie or local storage)

Not to be confused with a global persistent states (like this or this).

It would be great if we could use the device fingerprint of the client to store a state object specific to that client.
Would that be possible?

1 Like

Iā€™m currently testing fingerprintjs2 for device fingerprinting, we could put that in a Streamlit component to send back browser data to the Streamlit server and hack the state implementation a bit to store device fingerprints instead of session ID.

But given the security policy of the componentā€™s IFrame Iā€™m not sure this library will be able to collect all of the device information it needs to create a decent fingerprint (and Iā€™m actually happy with this. From a user perspective, even if itā€™s for a small Streamlit app, there may need to be some form of acceptance from the user to be tracked by device. Being prevented from running arbitrary JS helps frame the question of user data collection better).

Best way is to try now :wink:

1 Like

Great! Thanks a lot. :slight_smile:
Please do update here on how it goes after you try it out.

Yeah hopefully someone tries before me as Iā€™ve got other things to do :slight_smile: you can eventually try running the code snippet in components.html and see what happens

1 Like

Would love to see a fingerprint/cookie solution as well :slight_smile: