-
Notifications
You must be signed in to change notification settings - Fork 4.4k
🐛 Bug Report: Session Doesn't Persist on Flutter Web #5645
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
Comments
Thanks for bringing this up @teneon . @gewenyu99 can you look into this? |
@lohanidamodar Any idea? Regardless, this probably has to do with localhost and Effect on customer websites and Microsoft services and products in Chrome version 80 or later. We fall back to local storage in this case, and it should still work on localhost, there might be something weird with how the browser handles these cookies, like if you've disabled them or if you're using incognito. I think you won't run into this issue outside of localhost development. |
@teneon can you share the code? Some issue might occur if you are accessing appwrite server over Also check localStorage to see if |
I was further testing this issue today. It turns out that the problem is when you launch Chrome (web device) via VSCode it always starts on a new port. So i tested it by specifying fixed port like this via CLI: And now the peristence works. Even if i close Chrome, restart it i am still logged in as expected. So i guess the problem i experienced is just that you have to use fixed port. However those error messages in Chrome devel tools (under issues) still remain while i am testing this locally: Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute I will test this on your cloud soon, wh 8000 ere as someone said problem should not occur. Best regards! |
Anyway, glad you figured it out. |
I am closing this issue since it is now fixed. |
👟 Reproduction steps
Hi,
i am using Flutter SDK
I have email/pass authentication added, so i can login, logout etc. Everything works fine on Android emulator, but when i start the project in Web (Chrome) there is an issue.
1st error: Indicate whether a cookie is intended to be set in a cross-site context by specifying its SameSite attribute
2nd error: Mark cross-site cookies as Secure to allow setting them in cross-site contexts
best regards,
Jim
👍 Expected behavior
I was searching issues and also docs on AppWrite, but i could not find a solution for this issue. Perhaps it is something simple that is either not yet well documented or i couldn't find it.
👎 Actual Behavior
On android emulator, i can restart the app (or even stop it and re-run it) and i get right back into HomeScreen as expected since i was already logged in and session is persistent as it should be.
But when i start the project on web device (chrome), then session is not
persistent. It always positions me at the LoginScreen when i stop and re-run the project (even though i am logged in). I guess it is not persistent, because of the cookie issues i have described above?
🎲 Appwrite version
Version 1.3.x
💻 Operating system
Linux
🧱 Your Environment
appwrite: ^9.0.0
appwrite console is version 1.3.3 ,locally installed while in development (later will be cloud)
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: