MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / getOrCreateSessionId

Function getOrCreateSessionId

website/src/lib/utils.ts:8–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6}
7
8export function getOrCreateSessionId(): string {
9 if (typeof window === "undefined") return "global";
10 let sessionId = localStorage.getItem("cgc-session-id");
11 if (!sessionId) {
12 sessionId = Math.random().toString(36).substring(2, 8);
13 localStorage.setItem("cgc-session-id", sessionId);
14 }
15 return sessionId;
16}

Callers 3

PRReviewerFunction · 0.90
CodeGraphViewerFunction · 0.90
ExploreFunction · 0.90

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected