Skip to content

Commit

Permalink
not removing other functions :)
Browse files Browse the repository at this point in the history
  • Loading branch information
vriken committed Dec 11, 2024
1 parent 6259ec4 commit a8fbe50
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ___TEMPLATE_PARAMETERS___
"name": "httpOnlyCookie",
"checkboxText": "Write the _dcid cookie as HttpOnly",
"simpleValueType": true,
"help": "If enabled, the _dcid cookie will be written with the HttpOnly flag, making it non-accsessible by javascript."
"help": "If enabled, the _dcid cookie will be written with the HttpOnly flag, making it non-accsessible by javascript.",
"defaultValue": false
},
{
Expand Down Expand Up @@ -646,16 +646,20 @@ function addRequiredParametersToEventModel(eventModel) {
return eventModel;
}

function storeClientId(eventModel) {
if (data.generateClientId) {
setCookie('_dcid', eventModel.client_id, {
domain: 'auto',
path: '/',
samesite: getCookieType(eventModel),
secure: true,
'max-age': 63072000, // 2 years
httpOnly: data.httpOnlyCookie,
});
function exposeFPIDCookie(eventModel) {
if (data.exposeFPIDCookie) {
let fpid = getCookieValues('FPID');
if (fpid.length) {
setCookie('FPIDP', fpid[0], {
domain: 'auto',
path: '/',
samesite: getCookieType(eventModel),
secure: true,
'max-age': 63072000, // 2 years
httpOnly: false,
});
}
}
}

Expand All @@ -667,7 +671,7 @@ function storeClientId(eventModel) {
samesite: getCookieType(eventModel),
secure: true,
'max-age': 63072000, // 2 years
httpOnly: false,
httpOnly: data.httpOnlyCookie,
});
}
}
Expand Down

0 comments on commit a8fbe50

Please sign in to comment.