Skip to content

Commit

Permalink
Merge pull request #13 from nordnet/httpOnly-toggle
Browse files Browse the repository at this point in the history
Http only toggle
  • Loading branch information
Bukashk0zzz authored Dec 12, 2024
2 parents f4d40e4 + 3033549 commit aec467b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions template.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ function storeClientId(eventModel) {
samesite: getCookieType(eventModel),
secure: true,
'max-age': 63072000, // 2 years
httpOnly: false,
httpOnly: data.httpOnlyCookie || false,
});
}
}
Expand Down Expand Up @@ -632,4 +632,4 @@ function parseUrlEncoded(data) {
}

return parsedData;
}
}
10 changes: 9 additions & 1 deletion template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ ___TEMPLATE_PARAMETERS___
"simpleValueType": true,
"help": "If enabled, the server only accessible FPID cookie, generated by UA/GA4 client, will be duplicated to FPIDP cookie, which will be accessible from the client JS. Highly recommend using this option only in case it is necessary."
},
{
"type": "CHECKBOX",
"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.",
"defaultValue": false
},
{
"type": "CHECKBOX",
"name": "generateClientId",
Expand Down Expand Up @@ -663,7 +671,7 @@ function storeClientId(eventModel) {
samesite: getCookieType(eventModel),
secure: true,
'max-age': 63072000, // 2 years
httpOnly: false,
httpOnly: data.httpOnlyCookie || false
});
}
}
Expand Down

0 comments on commit aec467b

Please sign in to comment.