I have this Nuxt 3 end point
// server/api/login.post.ts
export default defineEventHandler((event) => {
const token = "set by login api";
// Delete all cookies
const cookies = parseCookies(event);
for (const cookieName in cookies) {
deleteCookie(event, cookieName);
}
setCookie(event, "pathumToken", token, {
httpOnly: true,
secure: true,
sameSite: "none",
path: "/",
});
const tokenResults = getCookie(event, "pathumToken");
// biome-ignore lint/suspicious/noConsole: <explanation>
console.log("Set Cookie =", tokenResults);
return {
token: tokenResults,
};
});
Which works fine in the local and returns the outpput correctly which is
{
"token": "set by login api"
}
But the same endpoint not working in the hosted environment. It won't return an error either it will return this
{}
What are the possible reasons that this could happen?