<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
function setCookiesFromParams(){
    try {
        const urlParams = new URLSearchParams(window.location.search);
        const domain = window.location.hostname;
        const cookieExpiryDays = 400; // The current GA cookies have a 400 day expiry.
        const userCookie = '_ga';
        const sessionStateCookie = '_ga_JQS6V7JBSJ'

        const domainParts = domain.split('.');
        const topLevelDomain = domainParts.slice(-2).join('.'); 

        // Check if both values are present in the query string
        if (urlParams.has(userCookie) &amp;&amp; urlParams.has(sessionStateCookie)) {     

            // Delete the existing cookies with the same names
            document.cookie = `${userCookie}=; path=/; domain=${topLevelDomain}; expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
            document.cookie = `${sessionStateCookie}=; path=/; domain=${topLevelDomain}; expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
        
            // Re-create cookies with values from querystring
            const expiryDate = new Date();
            expiryDate.setDate(expiryDate.getDate() + cookieExpiryDays);          
            document.cookie = `${userCookie}=${urlParams.get(userCookie)}; path=/; domain=${topLevelDomain}; expires=${expiryDate.toUTCString()};`;
            document.cookie = `${sessionStateCookie}=${urlParams.get(sessionStateCookie)}; path=/; domain=${topLevelDomain}; expires=${expiryDate.toUTCString()};`;            
        }
    } catch (error) {
        console.error('Error in cookie helper:', error);
    }
}

(function() {
    setCookiesFromParams();
})();
</pre></body></html>