serialize

Bun

Symbol

Cookie.serialize

serialize(): string

Serialize the cookie to a string

const cookie = Bun.Cookie.from("session", "abc123", {
  domain: "example.com",
  path: "/",
  secure: true,
  httpOnly: true
}).serialize(); // "session=abc123; Domain=example.com; Path=/; Secure; HttpOnly; SameSite=Lax"