Can't connect when api on different subdomains / domains

Hello, I have my api running on api.domain.io and my app on app.domain.io

On my configuration I have
  advanced: {
    defaultCookieAttributes: {
      sameSite: "none",
      secure: true,
      partitioned: true,
    },
  }


On client side I have
  fetchOptions: {
    credentials: "include",
  },


And on my API :
const corsConfig = {
  origin: [env.APP_URL, "http://localhost:3002"],
  credentials: true,
  allowedHeaders: ["Content-Type", "Authorization", "Cookie"],
};



I send a magic link that set cookies with domain api.domain.io but when I click on the magic link that didn't connect me and cookies disappear I don't understand why

My API is with hono and my app is with nextjs

Please help 🙏
Was this page helpful?