Skip to content

Commit ee74452

Browse files
fix: Secure flag in clearTrackingCookies; improve Google Signals disclosure
- Add Secure flag to clearTrackingCookies() deletion attempts so GA4 cookies set over HTTPS (which carry Secure) are actually deleted on revocation — previously silent failures on HTTPS - Update Google Signals description to disclose cross-site data use and Google account association per GDPR Art. 4(11)/7 informed consent requirements
1 parent 1c42613 commit ee74452

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

EssentialCSharp.Web/wwwroot/js/consent-manager.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class ConsentManager {
143143
<span class="consent-slider"></span>
144144
<div class="consent-info">
145145
<strong>Google Signals</strong>
146-
<p>Consent signals passed to Google to support analytics modeling and measurement. No advertisements are served on this site.</p>
146+
<p>Allows Google to associate your visit with your Google account for analytics modeling and cross-site measurement. No advertisements are served on this site, but Google may use this data across its services.</p>
147147
</div>
148148
</label>
149149
</div>
@@ -457,9 +457,10 @@ class ConsentManager {
457457
const allCookies = [...new Set([...trackingCookies, ...ga4Cookies])];
458458

459459
allCookies.forEach(cookieName => {
460-
document.cookie = `${cookieName}=;${expired};path=/`;
460+
const secure = window.location.protocol === 'https:' ? ';Secure' : '';
461+
document.cookie = `${cookieName}=;${expired};path=/${secure}`;
461462
domains.forEach(domain => {
462-
document.cookie = `${cookieName}=;${expired};path=/;domain=${domain}`;
463+
document.cookie = `${cookieName}=;${expired};path=/;domain=${domain}${secure}`;
463464
});
464465
});
465466
}

0 commit comments

Comments
 (0)