Replace crypto.randomUUID with fallback for HTTP contexts
crypto.randomUUID() requires secure context (HTTPS). Use Date.now + Math.random fallback for session ID generation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e041c6d9e8
commit
df06d6741e
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
let chatSessionId = sessionStorage.getItem('chat_session');
|
let chatSessionId = sessionStorage.getItem('chat_session');
|
||||||
if (!chatSessionId) {
|
if (!chatSessionId) {
|
||||||
chatSessionId = crypto.randomUUID();
|
chatSessionId = 'sess-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 10);
|
||||||
sessionStorage.setItem('chat_session', chatSessionId);
|
sessionStorage.setItem('chat_session', chatSessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user