Hey @inba, Welcome to the community,
You can use the session state for this,
if not state.user:
username = st.text_input(âUser Name:â,value="")
password = st.text_input(âPassword:â, value="", type=âpasswordâ)
state.user = authenticate(username, password)
else:
st.write(f"Hey {state.user.name} !")
For reference of Session state, Multi-page app with session state
Hope it helps !