diff --git a/client-frameworks-support/client-support-angular/package-lock.json b/client-frameworks-support/client-support-angular/package-lock.json index 51f471dbc3..f5d4a1f99c 100644 --- a/client-frameworks-support/client-support-angular/package-lock.json +++ b/client-frameworks-support/client-support-angular/package-lock.json @@ -29,7 +29,7 @@ "@types/jasmine": "~3.6.0", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", - "engine.io": "~6.5.5", + "engine.io": "~6.6.2", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.3.16", @@ -4583,10 +4583,11 @@ "dev": true }, "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -5295,9 +5296,9 @@ } }, "node_modules/engine.io": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", - "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz", + "integrity": "sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw==", "dev": true, "license": "MIT", "dependencies": { @@ -5306,7 +5307,7 @@ "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", - "cookie": "~0.4.1", + "cookie": "~0.7.2", "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", @@ -11278,6 +11279,38 @@ "node": ">=10.0.0" } }, + "node_modules/socket.io/node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/socket.io/node_modules/engine.io": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", + "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.4.1", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1" + }, + "engines": { + "node": ">=10.2.0" + } + }, "node_modules/sockjs": { "version": "0.3.24", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", diff --git a/client-frameworks-support/client-support-angular/package.json b/client-frameworks-support/client-support-angular/package.json index 3e41b843de..1295ec1254 100644 --- a/client-frameworks-support/client-support-angular/package.json +++ b/client-frameworks-support/client-support-angular/package.json @@ -34,7 +34,7 @@ "@types/jasmine": "~3.6.0", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", - "engine.io": "~6.5.5", + "engine.io": "~6.6.2", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.3.16", diff --git a/client/src/lifecycleManager.js b/client/src/lifecycleManager.js index f186c1b6d1..3abbe9720d 100644 --- a/client/src/lifecycleManager.js +++ b/client/src/lifecycleManager.js @@ -146,16 +146,14 @@ class LifecycleManager extends LuigiClientBase { let tpc = 'enabled'; let cookies = document.cookie; let luigiCookie; - let luigiCookieKey; if (cookies) { luigiCookie = cookies .split(';') .map(cookie => cookie.trim()) - .find(cookie => cookie == 'luigiCookie=true'); + .find(cookie => cookie === 'luigiCookie=true'); } if (luigiCookie === 'luigiCookie=true') { - luigiCookieKey = luigiCookie.split('=')[0]; - document.cookie = luigiCookieKey + '=; Max-Age=-99999999; SameSite=None; Secure'; + document.cookie = 'luigiCookie=; Max-Age=-99999999; SameSite=None; Secure'; } document.cookie = 'luigiCookie=true; SameSite=None; Secure'; cookies = document.cookie; @@ -163,11 +161,11 @@ class LifecycleManager extends LuigiClientBase { luigiCookie = cookies .split(';') .map(cookie => cookie.trim()) - .find(cookie => cookie == 'luigiCookie=true'); + .find(cookie => cookie === 'luigiCookie=true'); } if (luigiCookie === 'luigiCookie=true') { + document.cookie = 'luigiCookie=; Max-Age=-99999999; SameSite=None; Secure'; window.parent.postMessage({ msg: 'luigi.third-party-cookie', tpc }, '*'); - document.cookie = luigiCookieKey + '=; Max-Age=-99999999; SameSite=None; Secure'; } else { tpc = 'disabled'; window.parent.postMessage({ msg: 'luigi.third-party-cookie', tpc }, '*'); diff --git a/container/cypress/e2e/test-app/iframe/iframe-container.cy.js b/container/cypress/e2e/test-app/iframe/iframe-container.cy.js index 55297964ff..0b6b5013e1 100644 --- a/container/cypress/e2e/test-app/iframe/iframe-container.cy.js +++ b/container/cypress/e2e/test-app/iframe/iframe-container.cy.js @@ -16,7 +16,7 @@ describe('Iframe Container Test', () => { .get('iframe') .then(() => { cy.wrap(stub).should('have.been.calledWith', 'set-third-party-cookies-request'); - cy.getCookie('luigiCookie').should('exist'); + cy.getCookie('luigiCookie').should('not.exist'); }); }); diff --git a/core/third-party-cookies/init.html b/core/third-party-cookies/init.html index 922b17dac4..01014781cc 100644 --- a/core/third-party-cookies/init.html +++ b/core/third-party-cookies/init.html @@ -2,7 +2,6 @@