Having trouble getting session cookie to store (lucia-auth, hono, cloudflare pages/worker)
My worker is hosted at api.domain.com and my frontend is using domain.com
When I post to api.domain.com/users from domain.com the response header shows the session cookie.
It then redirects to domain.com/email-verification, but the cookie is not stored in the browser.
What am I doing wrong? Any assistance is greatly appreciated.
Code (I removed some stuff to save space)
https://pastebin.com/70cy8PzV
Pastebin
```// IMPORTS SECTION// ---------------...// INTERFACES SECTION// -...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
3 Replies
Response:
Cookies
Finally figured it out! In your fetch request, even if its a POST, you must set
credentials: "include",
and in your cors set credentials / Access-Control-Expose-Headers to true.