()
| 6 | } |
| 7 | |
| 8 | export 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 | } |
no test coverage detected