1export function setCookie(name, value = "", days = 365) { 2 let expires = "" 3 4 const date = new Date() 5 date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000) 6 expires = `; expires=${date.toUTCString()}` 7 8 document.cookie = `${name}=${value}${expires}; path=/` 9} 10 11export function readCookie(name) { 12 const nameEQ = `${name}=` 13 const ca = document.cookie.split(";") 14 15 for (let i = 0; i < ca.length; i++) { 16 let c = ca[i] 17 while (c.charAt(0) === " ") c = c.substring(1, c.length) 18 if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length) 19 } 20 21 return null 22}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.