I'm developing a Streamlit application and need to understand how to manage session state effectively. Please navigate to the 'Session State' section within the Streamlit documentation. Identify what session state is, how to initialize and update it, and how to use callbacks for interactive elements that modify state.
Navigate to 'docs.streamlit.io'. Click on 'Develop' (ID 53). Click on 'Concepts' (ID 61). Click on 'Session State' (ID 96). Identify the definition of Streamlit's session state. Locate examples or explanations for initializing session state variables. Find information on how to update session state variables. Determine how callbacks are used with widgets to modify session state. Synthesize all gathered information into a concise answer.
The agent successfully navigates to the 'Session State' page. The agent defines session state as a way to share variables between reruns for a given user session. The agent explains that session state variables can be initialized like a Python dictionary (e.g., `st.session_state['key'] = value`). The agent explains that session state variables can be updated by assigning new values to their keys (e.g., `st.session_state.key = new_value`). The agent explains that callbacks can be used with widgets (e.g., `st.button`, `st.slider`) by passing a function to the `on_change` or `on_click` parameter to modify session state when the widget's value changes or is interacted with.