{"id":10250,"date":"2026-08-15T00:38:24","date_gmt":"2026-08-14T22:38:24","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/blog\/toolbox\/set-cookie-itp-lifetime-simulator\/"},"modified":"2026-08-15T00:38:24","modified_gmt":"2026-08-14T22:38:24","slug":"set-cookie-itp-lifetime-simulator","status":"publish","type":"page","link":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/","title":{"rendered":"Set-Cookie Analyzer &#038; ITP Lifetime Simulator"},"content":{"rendered":"<div class=\"gtm-analyser-container\" style=\"background: var(--bg-panel, #1e1e24); padding: 25px; border-radius: 8px; border: 1px solid var(--border, #2a2a35);\">\n<p style=\"color: var(--text-secondary, #a0a0b0); margin-bottom: 20px;\">A cookie asks for two years and gets seven days. Which of the two applies depends on the way it was set, not on the header. Paste the header, say how it was set, and the real lifetime appears.<\/p>\n<p>    <label for=\"ck-eingabe\" style=\"color: var(--text-secondary, #a0a0b0); display: block; font-size: 0.85rem; margin-bottom: 5px;\">Set-Cookie header, one per line<\/label><br \/>\n    <textarea id=\"ck-eingabe\" class=\"form-control\" style=\"width: 100%; height: 110px; padding: 12px; background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); color: var(--text-primary, #e8e8ee); border-radius: 6px; font-family: monospace; font-size: 0.85rem; box-sizing: border-box;\" placeholder=\"Set-Cookie: _ga=GA1.1.123.456; Max-Age=63072000; Path=\/; SameSite=Lax\"><\/textarea><\/p>\n<div style=\"display: flex; gap: 12px; flex-wrap: wrap; margin-top: 15px;\">\n<div style=\"flex: 1; min-width: 210px;\">\n            <label for=\"ck-quelle\" style=\"color: var(--text-secondary, #a0a0b0); display: block; font-size: 0.85rem; margin-bottom: 5px;\">Set by<\/label><br \/>\n            <select id=\"ck-quelle\" class=\"form-control\" style=\"width: 100%; padding: 10px; background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); color: var(--text-primary, #e8e8ee); border-radius: 6px; font-family: monospace; box-sizing: border-box;\"><option value=\"http\">HTTP response header<\/option><option value=\"js\">document.cookie in JavaScript<\/option><\/select>\n        <\/div>\n<div style=\"flex: 1; min-width: 210px;\">\n            <label for=\"ck-lage\" style=\"color: var(--text-secondary, #a0a0b0); display: block; font-size: 0.85rem; margin-bottom: 5px;\">Context<\/label><br \/>\n            <select id=\"ck-lage\" class=\"form-control\" style=\"width: 100%; padding: 10px; background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); color: var(--text-primary, #e8e8ee); border-radius: 6px; font-family: monospace; box-sizing: border-box;\"><option value=\"erst\">own domain, own server<\/option><option value=\"cname\">own subdomain, CNAME to a service provider<\/option><option value=\"dritt\">third-party context<\/option><\/select>\n        <\/div>\n<div style=\"flex: 1; min-width: 210px;\">\n            <label for=\"ck-schema\" style=\"color: var(--text-secondary, #a0a0b0); display: block; font-size: 0.85rem; margin-bottom: 5px;\">Scheme<\/label><br \/>\n            <select id=\"ck-schema\" class=\"form-control\" style=\"width: 100%; padding: 10px; background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); color: var(--text-primary, #e8e8ee); border-radius: 6px; font-family: monospace; box-sizing: border-box;\"><option value=\"https\">https<\/option><option value=\"http\">http<\/option><\/select>\n        <\/div>\n<\/p><\/div>\n<div style=\"display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0;\">\n        <button id=\"ck-btn\" class=\"button\" style=\"background: var(--accent, #7ee787); color: #0b1114; border: none; padding: 12px 24px; border-radius: 6px; font-weight: 700; cursor: pointer;\">Analyse<\/button><br \/>\n        <button id=\"ck-beispiel\" class=\"button\" type=\"button\" style=\"background: transparent; color: var(--text-primary, #e8e8ee); border: 1px solid var(--border, #2a2a35); padding: 12px 20px; border-radius: 6px; font-weight: 700; cursor: pointer;\">Load example<\/button>\n    <\/div>\n<div id=\"ck-ergebnis\" style=\"margin-top: 22px;\"><\/div>\n<\/div>\n<p><script>\n(function () {\n    'use strict';<\/p>\n<p>    const T = {\"einleitung\":\"A cookie asks for two years and gets seven days. Which of the two applies depends on the way it was set, not on the header. Paste the header, say how it was set, and the real lifetime appears.\",\"label_header\":\"Set-Cookie header, one per line\",\"label_quelle\":\"Set by\",\"quelle_http\":\"HTTP response header\",\"quelle_js\":\"document.cookie in JavaScript\",\"label_lage\":\"Context\",\"lage_erst\":\"own domain, own server\",\"lage_cname\":\"own subdomain, CNAME to a service provider\",\"lage_dritt\":\"third-party context\",\"label_schema\":\"Scheme\",\"knopf\":\"Analyse\",\"beispiel\":\"Load example\",\"fehler_leer\":\"No header was entered.\",\"fehler_zeile\":\"This line carries no name=value pair: %s\",\"sitzung\":\"session cookie\",\"geloescht\":\"not kept\",\"nicht_gesetzt\":\"not set\",\"ja\":\"yes\",\"nein\":\"no\",\"d_sekunden\":\"seconds\",\"d_minuten\":\"minutes\",\"d_stunden\":\"hours\",\"d_tage\":\"days\",\"d_jahre\":\"years\",\"l_wert\":\"Value\",\"l_laufzeit\":\"Requested lifetime\",\"h_browser\":\"What the browsers make of it\",\"h_befunde\":\"Findings\",\"h_empfehlung\":\"Header as it would hold up\",\"s_unveraendert\":\"keeps the requested lifetime\",\"s_js\":\"Safari caps every cookie written through document.cookie at seven days.\",\"s_cname\":\"The response comes from a CNAME pointing elsewhere, and Safari caps those cookies at seven days as well.\",\"s_dritt\":\"In a third-party context Safari blocks the cookie outright.\",\"c_400\":\"Chrome caps every cookie at 400 days.\",\"c_dritt\":\"Third-party cookies are being retired; without CHIPS partitioning nothing arrives here.\",\"f_400\":\"Firefox caps every cookie at 400 days.\",\"f_dritt\":\"Firefox partitions third-party cookies per site, so each site sees its own.\",\"b_gross\":\"Name and value together are %s bytes. Above 4096 bytes the browser drops the cookie without a word.\",\"b_none_ohne_secure\":\"SameSite=None without Secure is rejected by every current browser.\",\"b_ohne_samesite\":\"SameSite is missing. Chrome treats that as Lax, so the cookie is absent from cross-site requests.\",\"b_samesite_unbekannt\":\"SameSite=%s is not a defined value, which lands the cookie back on the default.\",\"b_none_erstpartei\":\"SameSite=None on a first-party cookie hands it out on every cross-site request as well, which is rarely intended.\",\"b_secure_ohne_tls\":\"Secure over plain http means the cookie is never stored.\",\"b_ohne_secure\":\"Without Secure the cookie also travels over unencrypted connections.\",\"b_httponly_js\":\"HttpOnly cannot be set from JavaScript. The attribute is ignored here.\",\"b_ohne_httponly\":\"Without HttpOnly any script on the page can read the cookie.\",\"b_host_secure\":\"The __Host- prefix requires Secure.\",\"b_host_domain\":\"The __Host- prefix forbids a Domain attribute.\",\"b_host_pfad\":\"The __Host- prefix requires Path=\\\/.\",\"b_secure_praefix\":\"The __Secure- prefix requires the Secure attribute.\",\"b_partitioned_secure\":\"Partitioned only works together with Secure.\",\"b_domain_punkt\":\"The leading dot in Domain has had no effect for years and can go.\",\"b_domain_ohne_punkt\":\"Domain=%s carries no dot, which no browser accepts outside of localhost.\",\"b_laufzeit_ungueltig\":\"The lifetime cannot be read: Max-Age has to be a whole number, Expires a date in the HTTP format.\",\"b_sitzung\":\"Neither Max-Age nor Expires: the cookie disappears when the browser closes.\",\"b_vergangenheit\":\"The point in time lies in the past, which deletes the cookie instead of setting it.\",\"b_beide_laufzeiten\":\"Max-Age and Expires are both present. Max-Age wins, Expires is only there for very old browsers.\",\"b_ueber_400\":\"The requested %s exceed the 400 days that browsers allow at most.\",\"b_cname\":\"Behind the CNAME sits a foreign provider. Safari treats such cookies like third-party ones and caps them at seven days.\",\"b_dritt\":\"In a third-party context the cookie only survives where third-party cookies still work at all.\",\"b_js_lang\":\"The cookie asks for more than seven days but is written from JavaScript, so Safari cuts it down. Setting it in the HTTP response from the own server is the way around it.\"};<\/p>\n<p>    \/\/ --- reine Auswertung ---<\/p>\n<p>    const TAG = 86400;\n    const VIERHUNDERT_TAGE = 400 * TAG;\n    const SIEBEN_TAGE = 7 * TAG;<\/p>\n<p>    function zerlegen(zeile) {\n        const roh = String(zeile === undefined || zeile === null ? '' : zeile).trim()\n            .replace(\/^set-cookie\\s*:\\s*\/i, '');\n        const keks = {\n            roh: roh, name: '', wert: '', attribute: {}, reihenfolge: [], gueltig: false\n        };\n        if (roh === '') { return keks; }<\/p>\n<p>        const teile = roh.split(';');\n        const erstes = teile[0];\n        const gleich = erstes.indexOf('=');\n        if (gleich <= 0) { return keks; }\n        keks.name = erstes.slice(0, gleich).trim();\n        keks.wert = erstes.slice(gleich + 1).trim();\n\n        for (let i = 1; i < teile.length; i++) {\n            const stueck = teile[i].trim();\n            if (stueck === '') { continue; }\n            const trenner = stueck.indexOf('=');\n            const schluessel = (trenner === -1 ? stueck : stueck.slice(0, trenner)).trim().toLowerCase();\n            const wert = trenner === -1 ? true : stueck.slice(trenner + 1).trim();\n            keks.attribute[schluessel] = wert;\n            keks.reihenfolge.push(schluessel);\n        }\n        keks.gueltig = keks.name !== '';\n        return keks;\n    }\n\n    function laufzeitSekunden(keks, jetzt) {\n        \/\/ Max-Age schlaegt Expires, so steht es in der Spezifikation.\n        const a = keks.attribute;\n        if (a['max-age'] !== undefined &#038;&#038; a['max-age'] !== true) {\n            const wert = parseInt(String(a['max-age']).trim(), 10);\n            if (!isFinite(wert)) { return { art: 'ungueltig', sekunden: 0 }; }\n            return { art: 'max-age', sekunden: wert };\n        }\n        if (a.expires !== undefined &#038;&#038; a.expires !== true) {\n            const zeit = Date.parse(String(a.expires));\n            if (!isFinite(zeit)) { return { art: 'ungueltig', sekunden: 0 }; }\n            return { art: 'expires', sekunden: Math.round((zeit - jetzt) \/ 1000) };\n        }\n        return { art: 'sitzung', sekunden: 0 };\n    }\n\n    function dauerText(sekunden) {\n        const s = Math.abs(Math.round(sekunden));\n        if (s < 60) { return s + ' ' + T.d_sekunden; }\n        if (s < 3600) { return Math.round(s \/ 60) + ' ' + T.d_minuten; }\n        if (s < TAG) { return Math.round(s \/ 3600) + ' ' + T.d_stunden; }\n        if (s < 90 * TAG) { return Math.round(s \/ TAG) + ' ' + T.d_tage; }\n        const jahre = s \/ (365 * TAG);\n        if (jahre >= 1) { return (Math.round(jahre * 10) \/ 10) + ' ' + T.d_jahre; }\n        return Math.round(s \/ TAG) + ' ' + T.d_tage;\n    }<\/p>\n<p>    function browserLaufzeiten(keks, gewuenscht, lage, quelle) {\n        const raus = [];<\/p>\n<p>        \/\/ Safari: alles, was per document.cookie entsteht, wird auf sieben\n        \/\/ Tage gekuerzt. Dasselbe gilt fuer Kekse aus einer Antwort, die\n        \/\/ ueber einen fremden CNAME kam.\n        let safari = gewuenscht;\n        let safariGrund = T.s_unveraendert;\n        if (quelle === 'js') {\n            safari = Math.min(gewuenscht, SIEBEN_TAGE);\n            safariGrund = T.s_js;\n        } else if (lage === 'cname') {\n            safari = Math.min(gewuenscht, SIEBEN_TAGE);\n            safariGrund = T.s_cname;\n        } else if (lage === 'dritt') {\n            safari = 0;\n            safariGrund = T.s_dritt;\n        }\n        raus.push({ name: 'Safari', sekunden: safari, grund: safariGrund, gekuerzt: safari < gewuenscht });\n\n        \/\/ Chrome kappt seit Version 104 jede Lebensdauer bei 400 Tagen.\n        let chrome = Math.min(gewuenscht, VIERHUNDERT_TAGE);\n        let chromeGrund = chrome < gewuenscht ? T.c_400 : T.s_unveraendert;\n        if (lage === 'dritt') { chromeGrund = T.c_dritt; }\n        raus.push({ name: 'Chrome', sekunden: chrome, grund: chromeGrund, gekuerzt: chrome < gewuenscht });\n\n        let firefox = Math.min(gewuenscht, VIERHUNDERT_TAGE);\n        let firefoxGrund = firefox < gewuenscht ? T.f_400 : T.s_unveraendert;\n        if (lage === 'dritt') { firefoxGrund = T.f_dritt; }\n        raus.push({ name: 'Firefox', sekunden: firefox, grund: firefoxGrund, gekuerzt: firefox < gewuenscht });\n\n        return raus;\n    }\n\n    function befunde(keks, laufzeit, lage, quelle, schema) {\n        const liste = [];\n        const a = keks.attribute;\n        const name = keks.name;\n        const sameSite = a.samesite === undefined ? '' : String(a.samesite).toLowerCase();\n        const sicher = a.secure === true || a.secure === '';\n        const nurHttp = a.httponly === true || a.httponly === '';\n\n        \/\/ Groesse\n        const groesse = (name + '=' + keks.wert).length;\n        if (groesse > 4096) {\n            liste.push({ schwer: true, text: T.b_gross.replace('%s', String(groesse)) });\n        }<\/p>\n<p>        \/\/ SameSite\n        if (sameSite === 'none' && !sicher) {\n            liste.push({ schwer: true, text: T.b_none_ohne_secure });\n        }\n        if (sameSite === '') {\n            liste.push({ schwer: false, text: T.b_ohne_samesite });\n        }\n        if (sameSite !== '' && ['strict', 'lax', 'none'].indexOf(sameSite) === -1) {\n            liste.push({ schwer: true, text: T.b_samesite_unbekannt.replace('%s', String(a.samesite)) });\n        }\n        if (sameSite === 'none' && lage === 'erst') {\n            liste.push({ schwer: false, text: T.b_none_erstpartei });\n        }<\/p>\n<p>        \/\/ Secure und Schema\n        if (sicher && schema === 'http') {\n            liste.push({ schwer: true, text: T.b_secure_ohne_tls });\n        }\n        if (!sicher && schema === 'https') {\n            liste.push({ schwer: false, text: T.b_ohne_secure });\n        }<\/p>\n<p>        \/\/ HttpOnly\n        if (nurHttp && quelle === 'js') {\n            liste.push({ schwer: true, text: T.b_httponly_js });\n        }\n        if (!nurHttp && quelle === 'http') {\n            liste.push({ schwer: false, text: T.b_ohne_httponly });\n        }<\/p>\n<p>        \/\/ Namenspraefixe\n        if (name.indexOf('__Host-') === 0) {\n            if (!sicher) { liste.push({ schwer: true, text: T.b_host_secure }); }\n            if (a.domain !== undefined) { liste.push({ schwer: true, text: T.b_host_domain }); }\n            if (a.path === undefined || String(a.path) !== '\/') { liste.push({ schwer: true, text: T.b_host_pfad }); }\n        }\n        if (name.indexOf('__Secure-') === 0 && !sicher) {\n            liste.push({ schwer: true, text: T.b_secure_praefix });\n        }<\/p>\n<p>        \/\/ Partitioned nach dem Modell der geteilten Ablage\n        if (a.partitioned !== undefined && !sicher) {\n            liste.push({ schwer: true, text: T.b_partitioned_secure });\n        }<\/p>\n<p>        \/\/ Domain\n        if (a.domain !== undefined && a.domain !== true) {\n            const domain = String(a.domain).trim();\n            if (domain.charAt(0) === '.') {\n                liste.push({ schwer: false, text: T.b_domain_punkt });\n            }\n            if (domain.indexOf('.') === -1) {\n                liste.push({ schwer: true, text: T.b_domain_ohne_punkt.replace('%s', domain) });\n            }\n        }<\/p>\n<p>        \/\/ Laufzeit\n        if (laufzeit.art === 'ungueltig') {\n            liste.push({ schwer: true, text: T.b_laufzeit_ungueltig });\n        }\n        if (laufzeit.art === 'sitzung') {\n            liste.push({ schwer: false, text: T.b_sitzung });\n        }\n        if (laufzeit.sekunden < 0 &#038;&#038; laufzeit.art !== 'sitzung') {\n            liste.push({ schwer: true, text: T.b_vergangenheit });\n        }\n        if (a['max-age'] !== undefined &#038;&#038; a.expires !== undefined) {\n            liste.push({ schwer: false, text: T.b_beide_laufzeiten });\n        }\n        if (laufzeit.sekunden > VIERHUNDERT_TAGE) {\n            liste.push({ schwer: true, text: T.b_ueber_400.replace('%s', dauerText(laufzeit.sekunden)) });\n        }<\/p>\n<p>        \/\/ Lage\n        if (lage === 'cname') {\n            liste.push({ schwer: true, text: T.b_cname });\n        }\n        if (lage === 'dritt') {\n            liste.push({ schwer: true, text: T.b_dritt });\n        }\n        if (quelle === 'js' && laufzeit.sekunden > SIEBEN_TAGE) {\n            liste.push({ schwer: true, text: T.b_js_lang });\n        }<\/p>\n<p>        return liste;\n    }<\/p>\n<p>    function empfehlung(keks, lage, quelle) {\n        const a = keks.attribute;\n        const teile = [keks.name + '=' + keks.wert];\n        const sameSite = a.samesite === undefined ? '' : String(a.samesite).toLowerCase();\n        teile.push('Max-Age=' + (lage === 'erst' && quelle === 'http' ? String(VIERHUNDERT_TAGE) : String(SIEBEN_TAGE)));\n        teile.push('Path=\/');\n        if (a.domain !== undefined && a.domain !== true) { teile.push('Domain=' + String(a.domain).replace(\/^\\.\/, '')); }\n        teile.push('Secure');\n        if (quelle === 'http') { teile.push('HttpOnly'); }\n        teile.push('SameSite=' + (sameSite === 'none' ? 'None' : 'Lax'));\n        return 'Set-Cookie: ' + teile.join('; ');\n    }<\/p>\n<p>    function untersuchen(text, lage, quelle, schema, jetzt) {\n        const ergebnis = { ok: false, fehler: '', kekse: [] };\n        const zeilen = String(text === undefined || text === null ? '' : text).split(\/\\r?\\n\/);\n        const zeit = isFinite(jetzt) ? jetzt : Date.now();<\/p>\n<p>        zeilen.forEach(function (zeile) {\n            if (String(zeile).trim() === '') { return; }\n            const keks = zerlegen(zeile);\n            if (!keks.gueltig) {\n                ergebnis.kekse.push({ gueltig: false, roh: String(zeile).trim() });\n                return;\n            }\n            const laufzeit = laufzeitSekunden(keks, zeit);\n            const gewuenscht = laufzeit.art === 'sitzung' ? 0 : Math.max(0, laufzeit.sekunden);\n            ergebnis.kekse.push({\n                gueltig: true,\n                name: keks.name,\n                wert: keks.wert,\n                attribute: keks.attribute,\n                laufzeit: laufzeit,\n                gewuenscht: gewuenscht,\n                browser: laufzeit.art === 'sitzung' ? [] : browserLaufzeiten(keks, gewuenscht, lage, quelle),\n                befunde: befunde(keks, laufzeit, lage, quelle, schema),\n                empfehlung: empfehlung(keks, lage, quelle)\n            });\n        });<\/p>\n<p>        if (!ergebnis.kekse.length) { ergebnis.fehler = T.fehler_leer; return ergebnis; }\n        ergebnis.ok = true;\n        return ergebnis;\n    }<\/p>\n<p>    if (typeof window !== 'undefined') {\n        window.LW_TEST = window.LW_TEST || {};\n        window.LW_TEST.CK = {\n            untersuchen: untersuchen, zerlegen: zerlegen,\n            laufzeitSekunden: laufzeitSekunden, dauerText: dauerText\n        };\n    }<\/p>\n<p>    \/\/ --- Anbindung an das Dokument ---<\/p>\n<p>    const btn = document.getElementById('ck-btn');\n    const out = document.getElementById('ck-ergebnis');\n    const feld = document.getElementById('ck-eingabe');\n    const quelleFeld = document.getElementById('ck-quelle');\n    const lageFeld = document.getElementById('ck-lage');\n    const schemaFeld = document.getElementById('ck-schema');\n    const beispielBtn = document.getElementById('ck-beispiel');\n    if (!btn || !out || !feld || !quelleFeld || !lageFeld || !schemaFeld || !beispielBtn) { return; }<\/p>\n<p>    const KASTEN = 'background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); border-radius: 6px; padding: 14px; margin-bottom: 18px;';\n    const UEBERSCHRIFT = 'color: var(--text-primary, #e8e8ee); font-weight: 700; margin-bottom: 8px;';<\/p>\n<p>    function el(tag, css, text) {\n        const knoten = document.createElement(tag);\n        if (css) { knoten.setAttribute('style', css); }\n        if (text !== undefined && text !== null) { knoten.textContent = text; }\n        return knoten;\n    }<\/p>\n<p>    function zeigen(erg) {\n        out.textContent = '';<\/p>\n<p>        erg.kekse.forEach(function (k) {\n            if (!k.gueltig) {\n                out.appendChild(el('div', 'background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); border-left: 3px solid #ffb86c; color: var(--text-secondary, #a0a0b0); padding: 14px; border-radius: 6px; margin-bottom: 18px;', T.fehler_zeile.replace('%s', k.roh)));\n                return;\n            }<\/p>\n<p>            out.appendChild(el('div', UEBERSCHRIFT, k.name));<\/p>\n<p>            const kasten = el('div', KASTEN);\n            const werte = [\n                [T.l_wert, k.wert.length > 60 ? k.wert.slice(0, 60) + '...' : k.wert],\n                [T.l_laufzeit, k.laufzeit.art === 'sitzung' ? T.sitzung : dauerText(k.gewuenscht) + ' (' + k.laufzeit.art + ')'],\n                ['Path', k.attribute.path === undefined ? T.nicht_gesetzt : String(k.attribute.path)],\n                ['Domain', k.attribute.domain === undefined ? T.nicht_gesetzt : String(k.attribute.domain)],\n                ['SameSite', k.attribute.samesite === undefined ? T.nicht_gesetzt : String(k.attribute.samesite)],\n                ['Secure', k.attribute.secure !== undefined ? T.ja : T.nein],\n                ['HttpOnly', k.attribute.httponly !== undefined ? T.ja : T.nein]\n            ];\n            if (k.attribute.partitioned !== undefined) { werte.push(['Partitioned', T.ja]); }\n            werte.forEach(function (paar) {\n                const z = el('div', 'display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 4px 0;');\n                z.appendChild(el('span', 'color: var(--text-secondary, #a0a0b0);', paar[0]));\n                z.appendChild(el('span', 'color: var(--text-primary, #e8e8ee); font-family: monospace; word-break: break-all; text-align: right;', paar[1]));\n                kasten.appendChild(z);\n            });\n            out.appendChild(kasten);<\/p>\n<p>            if (k.browser.length) {\n                out.appendChild(el('div', UEBERSCHRIFT, T.h_browser));\n                const tabelle = el('div', KASTEN);\n                k.browser.forEach(function (b) {\n                    const z = el('div', 'display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border, #2a2a35);');\n                    z.appendChild(el('span', 'width: 80px; color: var(--text-primary, #e8e8ee); font-weight: 700;', b.name));\n                    z.appendChild(el('span', 'width: 110px; font-family: monospace; color: ' + (b.gekuerzt ? '#ffb86c' : 'var(--accent, #7ee787)') + ';', b.sekunden <= 0 ? T.geloescht : dauerText(b.sekunden)));\n                    z.appendChild(el('span', 'flex: 1; color: var(--text-secondary, #a0a0b0); font-size: 0.85rem; line-height: 1.5;', b.grund));\n                    tabelle.appendChild(z);\n                });\n                out.appendChild(tabelle);\n            }\n\n            if (k.befunde.length) {\n                out.appendChild(el('div', UEBERSCHRIFT, T.h_befunde));\n                const kasten2 = el('div', KASTEN);\n                k.befunde.forEach(function (b) {\n                    const z = el('div', 'display: flex; gap: 10px; padding: 5px 0;');\n                    z.appendChild(el('span', 'color: ' + (b.schwer ? '#ffb86c' : 'var(--text-secondary, #a0a0b0)') + '; font-family: monospace;', b.schwer ? '!' : '-'));\n                    z.appendChild(el('span', 'color: var(--text-secondary, #a0a0b0); font-size: 0.9rem; line-height: 1.5;', b.text));\n                    kasten2.appendChild(z);\n                });\n                out.appendChild(kasten2);\n            }\n\n            out.appendChild(el('div', UEBERSCHRIFT, T.h_empfehlung));\n            out.appendChild(el('pre', 'background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); color: var(--text-primary, #e8e8ee); padding: 16px; border-radius: 6px; overflow-x: auto; font-family: monospace; font-size: 0.85rem; white-space: pre-wrap; word-break: break-all; margin-bottom: 22px;', k.empfehlung));\n        });\n    }\n\n    btn.addEventListener('click', function () {\n        const erg = untersuchen(feld.value, lageFeld.value, quelleFeld.value, schemaFeld.value, Date.now());\n        out.textContent = '';\n        if (!erg.ok) {\n            out.appendChild(el('div', 'background: var(--bg-body, #14141a); border: 1px solid var(--border, #2a2a35); border-left: 3px solid #ffb86c; color: var(--text-secondary, #a0a0b0); padding: 14px; border-radius: 6px;', erg.fehler));\n            return;\n        }\n        zeigen(erg);\n    });\n\n    beispielBtn.addEventListener('click', function () {\n        feld.value = 'Set-Cookie: _ga=GA1.1.1234567890.1785578400; Max-Age=63072000; Path=\/; SameSite=Lax';\n        quelleFeld.value = 'js';\n        lageFeld.value = 'erst';\n        schemaFeld.value = 'https';\n        btn.click();\n    });\n})();\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reads a Set-Cookie header, checks the attributes browsers reject outright, and shows how long the cookie really survives in Safari, Chrome and Firefox.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":38,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template-tool-base.php","meta":{"footnotes":""},"tags":[91279,91061,91115],"class_list":["post-10250","page","type-page","status-publish","hentry","tag-prywatnosc-danych-pl","tag-server-side-gtm","tag-web-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Set-Cookie Analyzer &amp; ITP Lifetime Simulator - Lukas Wojcik - Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Set-Cookie Analyzer &amp; ITP Lifetime Simulator - Lukas Wojcik - Blog\" \/>\n<meta property=\"og:description\" content=\"Reads a Set-Cookie header, checks the attributes browsers reject outright, and shows how long the cookie really survives in Safari, Chrome and Firefox.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/08\/og-default.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/set-cookie-itp-lifetime-simulator\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/set-cookie-itp-lifetime-simulator\\\/\",\"name\":\"Set-Cookie Analyzer & ITP Lifetime Simulator - Lukas Wojcik - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"datePublished\":\"2026-08-14T22:38:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/set-cookie-itp-lifetime-simulator\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/set-cookie-itp-lifetime-simulator\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/set-cookie-itp-lifetime-simulator\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Toolbox\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/toolbox\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Set-Cookie Analyzer &#038; ITP Lifetime Simulator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"luky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"luky\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Set-Cookie Analyzer & ITP Lifetime Simulator - Lukas Wojcik - Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/","og_locale":"en_US","og_type":"article","og_title":"Set-Cookie Analyzer & ITP Lifetime Simulator - Lukas Wojcik - Blog","og_description":"Reads a Set-Cookie header, checks the attributes browsers reject outright, and shows how long the cookie really survives in Safari, Chrome and Firefox.","og_url":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/","og_site_name":"Lukas Wojcik - Blog","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/08\/og-default.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/","url":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/","name":"Set-Cookie Analyzer & ITP Lifetime Simulator - Lukas Wojcik - Blog","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"datePublished":"2026-08-14T22:38:24+00:00","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/set-cookie-itp-lifetime-simulator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Toolbox","item":"https:\/\/www.lukaswojcik.com\/blog\/en\/toolbox\/"},{"@type":"ListItem","position":3,"name":"Set-Cookie Analyzer &#038; ITP Lifetime Simulator"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"luky","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"luky"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/10250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=10250"}],"version-history":[{"count":0,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/10250\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/pages\/38"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=10250"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/tags?post=10250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}