
Hello everyone, i'm having trouble understanding how to set the auth enviroment in dev(localhost). My idea is to get that cookie saved and use it to make request to appwrite using SSR setting the cookie manually in the request headers.
1- web sdk -> no cookies get saved, only the local storage fallback. 2-rest api -> the cookie gets set with the domain ".cloud.appwrite.io" but as soon as i refresh the page it gets deleted, i asume is something related to the domain.
So my question is how do i make the cookies get set and persisted in localhost dev?
At the moment i don't have a custom domain to set that up. I did create a web app in the appwrite console with the hostname localhost.

sorry to bother again, anyone has an example of how to implement it? thanks

You could try to modify your hosts file since you don't have a domain.

What framework are you using?

newbiew here, what would i need to include in the host file? i'm using sveltekit

Search online about hosts files

As for svelte, check out this demo: https://svelte-kit.ssr.almostapps.eu/

okey, i for sure need to learn more about it. i tried setting the local host to this domain ".cloud.appwrite.io" but didnt work. that would be the correct one to include?

You can't have the same domain (localhost) pointed at 2 different things

ohh, i will look into it. thanks for the help

i will add my two cents, i hope you don't mind. maybe it's me that is the complete newbie but it would be helpful if in the docs would say something about this and maybe provide an example on how to handle it. thanks again for the help and love appwrite!

Usually, I advise against SSR because it's very complicated.
Recommended threads
- createDocument bug
why Im getting this??? let me make it easy for you. Do you have Indexes? No. Do you have relationship attributes? No. And the funny part is that it creates the ...
- "Invalid relationship value. Must be eit...
In my app i am trying to update the documents in my databse from a form in my app, and i am getting this error Error updating event users: AppwriteException: I...
- grant permisions only to users in collec...
I'm building a web app and instead of using Appwrite Auth, I made my own custom auth system that stores user data in documents. I have a "Profile" page where lo...
