CSRF-X Auth Library - v1.0.3
    Preparing search index...

    Function buildCookieHeader

    • Serializes a map of cookies into a valid Cookie request header string.

      Parameters

      • cookies: Map<string, string>

        A Map where keys are cookie names and values are cookie values.

      Returns string

      A semicolon‑separated string suitable for the Cookie header.

      The generated string is in the format name1=value1; name2=value2; ....
      No encoding or escaping is performed – the caller must ensure that names
      and values are already safe for HTTP headers (i.e., they do not contain
      characters that would break the header syntax, such as semicolons, commas,
      or whitespace).

      const cookies = new Map([['sessionId', 'abc123'], ['theme', 'dark']]);
      const header = buildCookieHeader(cookies);
      // header === "sessionId=abc123; theme=dark"

      0.1.1