Back

[SOLVED] Appwrite Cloud for web - cookie setting issues

  • 0
  • Web
  • Cloud
ray1023
22 Sep, 2023, 15:14

When using appwrite cloud with web- to get cookies set to work(due to origin issues), I had to:

  1. You have to use custom domains.
  2. You can’t point domain.com to appwrite cloud api - because I can’t create CNAME @- so, I had to create api.domain.com.
  3. Then I had to set my web to web.api.domain.com. - to allow it to accept .api.domain.com. Cookies.

Is there an alternative solution?

TL;DR
The user experienced issues with cookie setting in Appwrite Cloud for web. The solution was to use custom domains and set the appwrite endpoint hostname as a subdomain of the app. For example, if the app runs on my-app.com, the user should use api.my-app.com for Appwrite. There is no alternative solution provided in the thread.
Drake
22 Sep, 2023, 18:12

so the appwrite endpoint hostname needs to be a subdomain of your app. For example, if your app runs on my-app.com, you can use api.my-app.com for Appwrite.

For more info, see https://appwrite.io/docs/custom-domains

ray1023
22 Sep, 2023, 23:36

When I do that, following the docs, the cookies get set with a domain of .api.my-app.com. However the web browser at my-app.com wouldn’t use them and shows this when inspecting the cookies.

ray1023
22 Sep, 2023, 23:36
Drake
23 Sep, 2023, 01:45

and you're accessing your app at apinative.com?

ray1023
23 Sep, 2023, 01:45

Exactly

Drake
23 Sep, 2023, 01:47

where are you seeing this?

Drake
23 Sep, 2023, 01:48

maybe clear your cookies and try again?

Drake
23 Sep, 2023, 01:49

seems to work fine for me

ray1023
24 Sep, 2023, 18:04

Thank you, it seems I had an issue with my browsers.

Drake
24 Sep, 2023, 23:16

[SOLVED] Appwrite Cloud for web - cookie setting issues

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