• Serialize data into a cookie header.

    Serialize the a name value pair into a cookie string suitable for http headers. An optional options object specified cookie parameters.

    serialize('foo', 'bar', { httpOnly: true }) => "foo=bar; httpOnly"

    Parameters

    • name: string
    • val: string
    • Optionalopts: Partial<
          {
              domain: any;
              encode: (string: any) => string;
              expires: any;
              httpOnly: boolean;
              maxAge: any;
              partitioned: any;
              path: any;
              priority: any;
              sameSite: any;
              secure: any;
          },
      >

    Returns string