![](https://cdn.discordapp.com/avatars/128370738821332992/a_b4454bc5ab285b1ef78f3a842fa66a9c.gif)
I'm sure this question has been answered before, but I couldn't find a good solution. I am new to Appwrite, and I'm selfhosting it at console.domain.com. I've set up a user account that I am trying to create an email session with. I get logged in, but the cookies don't set and as soon as I refresh, it acts like I am logged out even though the session is still active in the appwrite console. I have set the domain in the Web platform in the console to * hoping that would fix the issue but unfortunately it does not.
What is the best way to develop an application locally with auth while hosting the appwrite console on a different domain? I can see the session getting created in the dev console, so that part all works. Do I need to set something in my hosts file?
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
I believe your apps domain and the domain for appwrite have to be the same for it to set cookies
![](https://cdn.discordapp.com/avatars/186656408450629633/ca3bdd514fde110c200d8e9cff0c1328.webp)
you can have multiple domains for appwrite
![](https://cdn.discordapp.com/avatars/128370738821332992/a_b4454bc5ab285b1ef78f3a842fa66a9c.gif)
So I'd have to run appwrite locally for it to work?
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
The fact that the cookies are not saved is browser behavior :/
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
What cookies get saved where is not something we/you/sdk control with code
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
The browser decides that is allowed and what isn't
![](https://cdn.discordapp.com/avatars/128370738821332992/a_b4454bc5ab285b1ef78f3a842fa66a9c.gif)
Is there a workaround or a browser setting/different browser I can try? Or should I just go the route of deploying my changes to something like vercel?
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
Try running Appwrite locally
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
I think it'll play nice(er)
![](https://cdn.discordapp.com/avatars/128370738821332992/a_b4454bc5ab285b1ef78f3a842fa66a9c.gif)
I will give that a shot, should be fairly easy. Thank You
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
My memory is fuzzy because I haven't touched my self-hosted setup on a long while. What browser are you using btw?
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
I believe we fall back to local storage for localhost
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
For me, it still works on localhost :/
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
but I know it could be problematic
![](https://cdn.discordapp.com/avatars/128370738821332992/a_b4454bc5ab285b1ef78f3a842fa66a9c.gif)
Firefox, chrome, edge, they all give similar results. I will give the hosting locally a shot, it makes the most sense for now
![](https://cdn.discordapp.com/avatars/128370738821332992/a_b4454bc5ab285b1ef78f3a842fa66a9c.gif)
The fallback cookie is there in localstorage but it doesn't seem to recognize my active session. Then again, Im fairly new to this and Im just cramming all the knowledge into my brain
![](https://cdn.discordapp.com/avatars/196742608846979072/2d77d54b9436266b9382b468d151a98f.webp)
Fallback is not your cookie, the cookie should be under cookies.
The cookies will not show up in your browser until you actually use them.
This is because the domain the cookies are on, is not the same domain as localhost, but don't worry!
Try making a account.get() request, it should world fine and your cookies will show up.
![](https://cdn.discordapp.com/avatars/128370738821332992/a_b4454bc5ab285b1ef78f3a842fa66a9c.gif)
Running Appwrite locally made this work, I can now log in, refresh the page, and it still has me as logged in
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
Yeah sounds like browser behavior 😐
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
Glad you have a solution 🙂 This will also work with some config for your self-hosted instance, but I believe it has to do with configuring domain + SSL correctly? I honestly don't remember.
![](https://cdn.discordapp.com/avatars/927583368776917012/d138080e528e8b2b2e048ee66ebc2d9b.webp)
@Steven What was the issue with cookies not saving for localhost again?
Recommended threads
- redirect_uri_mismatch in Google OAuth2
Hi all. I'm hosting my appwrite on my own VPS but I', having trouble creating a session for an authenticated user via gmail. When I run the appwrite endpoint wi...
- Private identifiers are only available w...
Hello folks, hope you all doing fine. Have any of you faced the error below? ```sh node_modules/node-appwrite/dist/id.d.ts:2:5 - error TS18028: Private iden...
- Graceful Error Handling with account.get...
Dear community, as I understood the best way to check for an active session is account.get() and if it returns an 401 there is no active session. Now I would pr...
![](/images/bgs/pre-footer.png)