{"id":19809,"date":"2026-07-13T11:37:00","date_gmt":"2026-07-13T10:37:00","guid":{"rendered":"https:\/\/esbuk.org\/?page_id=19809"},"modified":"2026-07-21T15:03:29","modified_gmt":"2026-07-21T14:03:29","slug":"esol-resource-registration-complete","status":"publish","type":"page","link":"https:\/\/esbuk.org\/index.php\/esol-resource-registration-complete\/","title":{"rendered":"ESOL Resources Registration"},"content":{"rendered":"\n<script>\n(function () {\n\n    \"use strict\";\n\n    \/******************************************************\n     * ESOL Skills for Life Resources Callback\n     ******************************************************\/\n\n    const COOKIE_NAME =\n        \"esol_resources_registered\";\n\n    const STORAGE_KEY =\n        \"esolReturnUrl\";\n\n    const FALLBACK_URL =\n        \"https:\/\/esbuk.org\/index.php\/esol-skills-for-life\/\";\n\n\n    \/******************************************************\n     * STEP 1\n     * Break out of the ClickDimensions iframe.\n     ******************************************************\/\n\n    if (window.self !== window.top) {\n\n        window.top.location.replace(\n            window.location.href\n        );\n\n        return;\n\n    }\n\n\n    \/******************************************************\n     * STEP 2\n     * Create the resources registration cookie.\n     ******************************************************\/\n\n    const expiry =\n        new Date();\n\n    expiry.setFullYear(\n        expiry.getFullYear() + 2\n    );\n\n    document.cookie =\n        COOKIE_NAME +\n        \"=true;\" +\n        \"expires=\" + expiry.toUTCString() + \";\" +\n        \"path=\/;\" +\n        \"domain=.esbuk.org;\" +\n        \"SameSite=Lax;\" +\n        \"Secure\";\n\n\n    \/******************************************************\n     * STEP 3\n     * Retrieve the original resource-page URL.\n     ******************************************************\/\n\n    let returnUrl =\n        null;\n\n    try {\n\n        returnUrl =\n            localStorage.getItem(\n                STORAGE_KEY\n            );\n\n    } catch (error) {\n\n        console.warn(\n            \"ESOL resources: unable to retrieve the return URL.\",\n            error\n        );\n\n    }\n\n\n    \/******************************************************\n     * STEP 4\n     * Remove the stored URL after reading it.\n     ******************************************************\/\n\n    try {\n\n        localStorage.removeItem(\n            STORAGE_KEY\n        );\n\n    } catch (error) {\n\n        console.warn(\n            \"ESOL resources: unable to remove the stored return URL.\",\n            error\n        );\n\n    }\n\n\n    \/******************************************************\n     * STEP 5\n     * Validate and redirect.\n     ******************************************************\/\n\n    if (returnUrl) {\n\n        try {\n\n            const parsedReturnUrl =\n                new URL(\n                    returnUrl,\n                    window.location.origin\n                );\n\n            \/*\n             * Only redirect to an ESB website URL.\n             *\/\n\n            if (\n                parsedReturnUrl.hostname === \"esbuk.org\" ||\n                parsedReturnUrl.hostname.endsWith(\".esbuk.org\")\n            ) {\n\n                window.location.replace(\n                    parsedReturnUrl.href\n                );\n\n                return;\n\n            }\n\n        } catch (error) {\n\n            console.warn(\n                \"ESOL resources: invalid return URL.\",\n                error\n            );\n\n        }\n\n    }\n\n    window.location.replace(\n        FALLBACK_URL\n    );\n\n})();\n<\/script>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"wp-custom-template-esb-template","meta":{"footnotes":""},"class_list":["post-19809","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/pages\/19809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/comments?post=19809"}],"version-history":[{"count":8,"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/pages\/19809\/revisions"}],"predecessor-version":[{"id":19857,"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/pages\/19809\/revisions\/19857"}],"wp:attachment":[{"href":"https:\/\/esbuk.org\/index.php\/wp-json\/wp\/v2\/media?parent=19809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}