1jQuery.cookie = function (key, value, options) { 2 3 // key and at least value given, set cookie... 4 if (arguments.length > 1 && String(value) !== "[object Object]") { 5 options = jQuery.extend({}, options); 6 7 if (value === null || value === undefined) { 8 options.expires = -1; 9 } 10 11 if (typeof options.expires === 'number') { 12 var days = options.expires, t = options.expires = new Date(); 13 t.setDate(t.getDate() + days); 14 } 15 16 value = String(value); 17 18 return (document.cookie = [ 19 encodeURIComponent(key), '=', 20 options.raw ? value : encodeURIComponent(value), 21 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 22 options.path ? '; path=' + options.path : '', 23 options.domain ? '; domain=' + options.domain : '', 24 options.secure ? '; secure' : '' 25 ].join('')); 26 } 27 28 // key and possibly options given, get cookie... 29 options = value || {}; 30 var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; 31 return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; 32}; 33
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.