Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supabase Auth session turns to ‘None’ every time you refresh on mobile browser #23700

Open
SuyogJo opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working needs-analysis Issue status is unknown and/or not possible to triage with the current info

Comments

@SuyogJo
Copy link

SuyogJo commented May 3, 2024

I'm encountering an issue with my Streamlit app. The app uses supabase auth and session. The print statement revealed that the session turns into ‘None’ every time you refresh the browser. But this only happens on mobile browsers. On a desktop browser, we can see that the session would not be ‘None’ even after refreshing the page.

Here's the relevant code snippet:

session = login_form(
    url=url,
    apiKey=key,
    providers=["google"],
)

print (session)

if not session:
    streamlit.warning('If you use Email Sign in/Sign up. Please Check Your Email To Verify Your Account. Thank you!', icon="🚨")

Context:

I'm using Streamlit for developing a web application that requires user authentication . The app uses supabase-streamlit-auth library for managing user sessions and authentication.

Observations:

The issue occurs specifically on mobile devices.
the session is ‘None’
Session works fine in desktop browsers
Expected Behavior:

After refreshing the page on mobile devices, the session should not be ‘None’

Question:

Has anyone encountered a similar issue with Streamlit apps on mobile devices? How did you solve it? Are there any best practices or alternative approaches for handling session management and page refreshes on mobile devices in Streamlit?

Any insights or suggestions would be greatly appreciated! Thank you!

@SuyogJo SuyogJo added the bug Something isn't working label May 3, 2024
@encima
Copy link
Contributor

encima commented May 3, 2024

Hi there,

Thanks for opening! This could be a few things. Can you confirm the mobile platform and browser that you are using?

My guess is this is due to how Streamlit stores the session (their SessionState) and potentially this is not supported on the mobile browser.

@encima encima added the needs-analysis Issue status is unknown and/or not possible to triage with the current info label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-analysis Issue status is unknown and/or not possible to triage with the current info
Projects
None yet
Development

No branches or pull requests

2 participants