1function createCookie(name,value,days,options = {}) 2{ 3 if (days) 4 { 5 var date = new Date(); 6 date.setTime(date.getTime()+(days*24*60*60*1000)); 7 var expires = "; expires="+date.toGMTString(); 8 } 9 else var expires = ""; 10 var updatedCookie = name+"="+encodeURIComponent(value)+expires+"; path=/"; 11 12 for (let optionKey in options) { 13 updatedCookie += "; " + optionKey; 14 let optionValue = options[optionKey]; 15 if (optionValue !== true) { 16 updatedCookie += "=" + optionValue; 17 } 18 } 19 document.cookie = updatedCookie; 20} 21 22function readCookie(name) 23{ 24 var nameEQ = name + "="; 25 var ca = document.cookie.split(';'); 26 for(var i=0;i < ca.length;i++) 27 { 28 var c = ca[i]; 29 while (c.charAt(0)==' ') c = c.substring(1,c.length); 30 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 31 } 32 return null; 33} 34 35function eraseCookie(name) 36{ 37 createCookie(name,"",-1); 38}
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.