I am using streamlit and I call a function in a separate function file from a login script, the function.py queries SQL and loads a bunch of data in the st.session as follows:
<code>st.session_state["company_id"] = company_id
</code>
<code>st.session_state["company_id"] = company_id
</code>
st.session_state["company_id"] = company_id
Once the user has logged in , I want to reference that st.session_state[“company_id”] from the rest of my application in all the other .py files, I have tried to output st.session_state[“company_id”] and all I get is:
“KeyError: ‘st.session_state has no key “connection_type”. Did you forget to initialize it?”