Redirect to another page on a button click

Hello,

I’m running streamlit==1.28.2

I have set up a multi-page app, and I also have authentication implemented. Therefore, there is a Logout button on the sidebar that controls some session_state variables when the user clicks on it.
The problem is that I did not manage to accomplish the following: I would like that when you click on the Logout button when you are on a web page different from the Home, the app automatically redirects you on the Home page.

Is that possible somehow?

Yes, that is possible! There is some work underway that should make this easier to do with plain streamlit, but for now you can use switch_page_button from streamlit-extras

https://arnaudmiribel.github.io/streamlit-extras/extras/switch_page_button/

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.