Skip to content
Back

Session cookies stored on wrong (sub-)domain

  • 0
  • 1
  • Auth
  • Web
  • Sites
  • Cloud
17 Jun, 2026, 08:24

Hi,

I own a domain example.com which is registered with the Appwrite nameserver. My website runs on Sites, using www.example.com as domain, and my functions use <function-name>.example.com. I added a custom domain for the Appwrite API called api.example.com, so it'll e.g. call api.example.com/v1/account to get the current user's information.

Here's the issue: When I login (using OTP), the session cookie is stored on .api.example.com, but my browser doesn't send these cookies to any other requests. I have some functions which require the user to be logged in.

Is there any way to configure Appwrite to set session cookies on .example.com instead?

TL;DR
The session cookies are being stored on `.api.example.com` instead of `.example.com`, causing login issues. Configure Appwrite to set session cookies on `.example.com` to solve the problem.
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