Spaces:
Sleeping
Sleeping
import streamlit as st | |
import uuid | |
def get_user_id(): | |
if "user_id" not in st.session_state: | |
query_params = st.query_params | |
user_id = query_params.get("user_id", None) | |
if not user_id: | |
user_id = str(uuid.uuid4()) | |
st.query_params["user_id"] = user_id | |
st.session_state.user_id = user_id | |
return st.session_state.user_id | |
user_id = get_user_id() | |
st.write(f"Your unique ID is: {user_id}") | |