Cookie parsing and serialization middleware for Hattip. This package exports three middleware functions:
Creates a middleware that parses incoming cookies and serializes outgoing cookies. It combines the functionality of the cookieParser
and cookieSerializer
.
Creates a middleware that parses incoming cookies and makes them available in the cookie
property of the request context.
If you only want to parse cookies and not serialize them, you can import cookieParser
from "@hattip/cookie/parse"
to avoid extending the request context type with serialization features.
Extends the request context type with setCookie
and deleteCookie
methods for sending and deleting cookies.
If you only want to serialize cookies and not parse them, you can import cookieSerializer
from "@hattip/cookie/serialize"
to avoid adding the cookie
property to the request context type.