st.logout is Streamlit’s native authentication action for ending the current logged-in session and returning the user to the app’s main page. It fits alongside st.login and st.user in an authentication flow backed by an OpenID Connect identity provider. section 8.4.3
Add a log-out action
Place st.logout() behind a Log out control or page. With native authentication, the call ends the user’s session and returns them to the app’s main page. A custom session-state flow instead clears the stored user and logged-in flag, then calls st.rerun() so the navigation changes immediately. section 8.4.3
