export function parseCookies(
  cookieHeader: string = "",
): Record<string, string> {
  return cookieHeader.split(";").reduce((acc: Record<string, string>, part) => {
    const [key, ...valueParts] = part.split("=");

    if (!key) return acc;

    const cookieName = key.trim();
    const cookieValue = valueParts.join("=").trim();

    acc[cookieName] = decodeURIComponent(cookieValue);
    return acc;
  }, {});
}
