1function createCookie(name, value, mins, hours, days) { 2 mins = typeof mins !== 'undefined' ? mins : 0; 3 hours = typeof hours !== 'undefined' ? hours : 0; 4 days = typeof days !== 'undefined' ? days : 0; 5 6 mins = mins * 60 * 1000; 7 hours = hours * 60 * 60 * 1000; 8 days = days * 24 * 60 * 60 * 1000; 9 expires = ""; 10 11 if (mins !== 0 || hours !== 0 || days !== 0) { 12 //Not a session cookie 13 var date = new Date(); 14 date.setTime(date.getTime() + mins + hours + days); 15 expires = "; expires=" + date.toGMTString(); 16 } 17 18 //Set the cookie 19 document.cookie = name + "=" + value + expires + "; path=/"; 20} 21 22//Look for a cookie based on name 23function getCookie(name) { 24 name = name + "="; 25 var cookies = document.cookie.split(";"); 26 for (var i = 0; i < cookies.length; i++) { 27 var c = cookies[i]; 28 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 29 if (c.indexOf(name) === 0) return c.substring(name.length, c.length); 30 } 31} 32 33function deleteCookie(name) { 34 document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/'; 35}
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.