In order to develop more advanced Streamlit applications, it is vital to establish session-specific data that can be used to deliver an enhanced user experience. Specifically, the application will need to preserve the user’s data and inputs using what is referred to as session states. These states can be set and accessed on demand whenever necessary, and they will persist when the user triggers a rerun of the Streamlit application or navigates between pages. In addition, we will establish a method to store state across multiple sessions using cookies, which can save data in the user’s browser for access when they restart the associated Streamlit application. Finally, we will learn how to record and visualize rich insights into how users interact with our application, providing analytics for both the developer and product owner alike.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Implementing Session State

  • Mohammad Khorasani,
  • Mohamed Abdou,
  • Javier Hernández Fernández

摘要

In order to develop more advanced Streamlit applications, it is vital to establish session-specific data that can be used to deliver an enhanced user experience. Specifically, the application will need to preserve the user’s data and inputs using what is referred to as session states. These states can be set and accessed on demand whenever necessary, and they will persist when the user triggers a rerun of the Streamlit application or navigates between pages. In addition, we will establish a method to store state across multiple sessions using cookies, which can save data in the user’s browser for access when they restart the associated Streamlit application. Finally, we will learn how to record and visualize rich insights into how users interact with our application, providing analytics for both the developer and product owner alike.