File size: 347 Bytes
91ee702
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
const COOKIE_REGEX = /(?:^|;\s*)_codex_session=([^;]*)/;

/** Extract the _codex_session cookie value from a Cookie header. */
export function parseSessionCookie(cookieHeader: string | undefined): string | undefined {
  if (!cookieHeader) return undefined;
  const match = COOKIE_REGEX.exec(cookieHeader);
  return match ? match[1] : undefined;
}