PageSourceSearch

https://www.vitalize.nl/static/version20261007093913/frontend/Vend…/js/cookie-domain-local-fix.min.js

js vitalize.nl collected 2026-10-08 08:25:05 UTC 1,097 bytes, 32 lines download raw bytes

1/**
2 * Force host-only cookies for local hosts and ensure form_key cookie is set.
3 */
4(function () {
5    function applyCookieConfigDomain() {
6        if (typeof window.COOKIE_CONFIG === 'object') {
7            window.COOKIE_CONFIG.domain = null;
8        }
9    }
10
11    function setFormKeyCookieFromDom() {
12        var input = document.querySelector('input[name="form_key"]');
13        if (!input || !input.value) {
14            return;
15        }
16        // Host-only, session lifetime, Lax same-site.
17        document.cookie = 'form_key=' + encodeURIComponent(input.value) + '; path=/; samesite=lax';
18    }
19
20    // Run immediately in case COOKIE_CONFIG is already present.
21    applyCookieConfigDomain();
22
23    // Ensure we run after DOM is ready so the hidden form_key input exists.
24    if (document.readyState === 'complete' || document.readyState === 'interactive') {
25        setFormKeyCookieFromDom();
26    } else {
27        document.addEventListener('DOMContentLoaded', function () {
28            applyCookieConfigDomain();
29            setFormKeyCookieFromDom();
30        }, {once: true});
31    }
32})();

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.