1function ctSetCookie(cookies) 2{ 3 4 let useCookies, useAltCookies 5 6 if ('undefined' !== typeof ct_use_cookies) { 7 useCookies = ct_use_cookies; 8 } else { 9 useCookies = false; 10 } 11 12 if ('undefined' !== typeof ct_use_alt_cookies) { 13 useAltCookies = ct_use_alt_cookies; 14 } else { 15 useAltCookies = false 16 } 17 18 if (useCookies) { 19 if (useAltCookies && useAltCookies === 1) { 20 let xhr = new XMLHttpRequest(); 21 22 let json = JSON.stringify(cookies); 23 24 xhr.open("POST", '/admin/config/cleantalk/set_alt_cookies') 25 xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8'); 26 27 xhr.send(json); 28 } else { 29 cookies.forEach( 30 function (e) { 31 let ctSecure = location.protocol === "https:" ? "; secure" : ""; 32 document.cookie = e.name + "=" + encodeURIComponent(e.value) + "; path=/; expires=0; samesite=lax" + ctSecure; 33 } 34 ) 35 } 36 } 37}
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.