H
Hono4w ago
mR.f3v3R

Hono: getCookie() Returns Undefined — Need Help!

Hey everyone! I'm working on a backend using the Hono framework and I'm trying to implement cookie-based authentication. I'm setting a JWT token in the cookie after login using setCookie, and I can see that the cookie is being set properly in the browser. But when I try to access it in my middleware using getCookie, it always returns undefined. I already set credentials: "include" on the frontend and allowed credentials in the CORS config, but still not working. Is there something I might be missing? Do I need to add any middleware to read cookies in Hono? Thanks in advance! 🙏
No description
No description
1 Reply
ambergristle
ambergristle4w ago
have you verified that it's included in the request headers? you shouldn't need to do anything special to access cookies, esp ones you've set

Did you find this page helpful?