Path: blob/main/doc/how_to/streamlit_migration/session_state.md
2012 views
Session State
Session state was added to Streamlit as an after thought to enable sharing variables between re-runs and across apps inside a multipage app.
Panels execution model is very different and session state can be handled automatically by storing variables in the applications namespace.
Migration Steps
Move your session state to the applications namespace, i.e. to variables defined in your application file.
Example
Dynamic Layout Example
Streamlit Dynamic Layout Example
With Streamlit you need session state to keep track of the dynamically created rows
.
Panel Dynamic Layout Example
As the Panel script is only executed once per session the rows
objects will keep track of your session state.