Hi,
I’m using Streamlit with AWS Cognito (Hosted UI / OIDC). Login works, but logout is inconsistent when I try to switch accounts.
Calling st.logout() clears Streamlit’s session, but the browser still has an authentication cookie, so when I click “Sign in” again Cognito (or my ALB/OIDC integration) sometimes re-authenticates automatically and I’m not prompted for credentials.
According to Cognito docs, I should call the Hosted UI logout endpoint:
https://.auth..amazoncognito.com/logout?client_id=<client_id>&logout_uri=
However, I still see auto-login occasionally, which makes me think the relevant cookie is not being cleared (or the logout redirect isn’t happening reliably).
Questions:
-
What’s the correct way to implement a reliable logout flow in Streamlit so the browser auth cookie is cleared every time?
-
If this is behind an ALB with Cognito authentication, do I also need to clear ALB auth cookies (e.g., AWSELBAuthSessionCookie*) in addition to calling Cognito /logout?
Thanks!