@nou7lh st.session_state has a very similar API to a normal python dictionary, so to get a specific entry you can either do:
st.session_state["page_number"]
(note that this will raise a KeyError if there is no page_number
)
or st.session_state.get("page_number", 0)
(this will either return the page_number, if it’s been set, or return 0, the default.
Here’s a related example: How to create streamlit app with pagination - #2 by ditw11mhs