Back

Browser sometimes does not set "X-fallback-cookies" when i do createOAuth2Session

  • 0
  • Accounts
  • Web
  • Apple
xue
26 Dec, 2023, 23:53

When i use createEmailSession, everything is fine. When i try to use with oauth2, browser sets cookies but in local storage.

I am sharing inspector

image 1 : redirect request and response from one of oauth2 provider. image 2: cookies section image 3 : local storage section

What is the possible reasons that browser sets cookies from response but does not set local storage for X-fallback-cookies ?

Thanks a lot for

TL;DR
User is experiencing an issue where their browser occasionally does not set "X-fallback-cookies" when they use the createOAuth2Session function. They are seeking assistance or a solution to this problem.
Drake
26 Dec, 2023, 23:58

In order for oauth to work, you must have custom domains configured so that cookies work. The fallback cookie is a FALLBACK. it's not supposed to be used in production

xue
27 Dec, 2023, 00:17

Ok, it works fine with custom domain i tested it severel times and now as well.

However sometimes it works with localhost or interal ip such as 192.168.0.xx if i provide this ip as a web platform in appwrite console.

i dont know how it works without custom domain. Because it needs for me to test on ionic-capacitor mobile app (hybrit) such as ios.

xue
27 Dec, 2023, 00:21

Im in stuck with oauth2, im trying to develop cross platform apps for PWA, ios, android by using capacitorjs. But if i trying to login with oauth2 in ios, it opens a browser and after logged in stays in browser with custom domain.

If i try to redirect to native app with success URL, it does not save any cookies and user not authorized. user only is authorized into browser in mobile not in native app. How can i handle with this situation @Drake ? Any idea ?

Drake
27 Dec, 2023, 17:59

Unfortunately, i don't know capactior so i can't say much else besides what i've already said in https://discord.com/channels/564160730845151244/1189434348114550874/1189440632733847602

xue
27 Dec, 2023, 21:29

Thanks a lot, im trying to do something if im done , im gonna update this linked thread as well.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more