MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / readSessionCookie

Function readSessionCookie

telemetry-dashboard/src/auth.ts:142–150  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

140}
141
142export function readSessionCookie(request: Request): string | null {
143 const header = request.headers.get('cookie');
144 if (!header) return null;
145 for (const part of header.split(';')) {
146 const cookie = part.trim();
147 if (cookie.startsWith(`${COOKIE_NAME}=`)) return cookie.slice(COOKIE_NAME.length + 1);
148 }
149 return null;
150}
151
152export function sessionCookie(token: string): string {
153 // Secure is accepted on http://localhost too, so `wrangler dev` still works.

Callers 1

hasValidSessionFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected