BunRequest object exposes a cookies property, a CookieMap for reading and modifying cookies. When using routes, Bun.serve() automatically tracks calls to request.cookies.set and applies them to the response.
Reading cookies
Read cookies from incoming requests using thecookies property on the BunRequest object:
Setting cookies
To set cookies, use theset method on the CookieMap from the BunRequest object.
Deleting cookies
To delete a cookie, use thedelete method on the request.cookies (CookieMap) object:
Set-Cookie header on the response with the Expires attribute set to a date in the past and an empty value.