Skip to content

Commit b40408c

Browse files
committed
Dynamische Cookie-Laufzeit
* **Privacy**: Dynamische Cookie-Laufzeit - Bei minimaler Zustimmung (nur notwendige Cookies) wird die Laufzeit auf 14 Tage begrenzt (Privacy by Design)
1 parent 612294f commit b40408c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@
88
* **Performance**: Interne Klassen (`Frontend`, `InlineConsent`, `GoogleConsentMode`) nutzen nun den Cache statt direkter SQL-Abfragen
99
* **Code-Qualität**: Refactoring der `InlineConsent` Klasse zur Vermeidung von Code-Duplizierung bei der Video-ID-Erkennung
1010
* **Statistik**: Neue Auswertung der Consent-Logs im Backend (Tägliche Consents, Top-Services)
11+
* **Privacy**: Dynamische Cookie-Laufzeit - Bei minimaler Zustimmung (nur notwendige Cookies) wird die Laufzeit auf 14 Tage begrenzt (Privacy by Design)
1112
* **API Dokumentation**: Neue Dokumentation der öffentlichen API in der README.md
1213

14+
### 🛡️ Security
15+
16+
* **CSP**: Nonce-Schutz für Inline-Skripte im Backend-Log hinzugefügt
17+
1318
### 🐛 Bugfixes
1419

1520
* **Button-Layout responsive optimiert**: Buttons passen sich jetzt der Textlänge an und nutzen auf Desktop `flex: 1` für gleichmäßige Verteilung
21+
* **Localization**: Fehlende Übersetzungen im Statistik-Modul ergänzt
1622

1723
---
1824

assets/consent_manager_frontend.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ function debugLog(message, data) {
248248
function saveConsent(toSave) {
249249
debugLog('saveConsent: Start', toSave);
250250
consents = [];
251+
var hasOptionalConsent = false;
251252
cookieData = {
252253
consents: [],
253254
version: addonVersion,
@@ -260,6 +261,9 @@ function debugLog(message, data) {
260261
// array mit cookie uids
261262
var cookieUids = safeJSONParse(el.getAttribute('data-cookie-uids'), []);
262263
if (el.checked || toSave === 'all') {
264+
if (!el.disabled) {
265+
hasOptionalConsent = true;
266+
}
263267
debugLog('saveConsent: Consent erteilt für', cookieUids);
264268
cookieUids.forEach(function (uid) {
265269
consents.push(uid);
@@ -314,7 +318,12 @@ function debugLog(message, data) {
314318
console.warn('Consent Manager: deleteCookies() failed before setting cookie', e);
315319
}
316320

317-
cmCookieAPI.set('consentmanager', JSON.stringify(cookieData));
321+
if (!hasOptionalConsent) {
322+
debugLog('saveConsent: Minimal consent only - setting short cookie lifetime (14 days)');
323+
cmCookieAPI.set('consentmanager', JSON.stringify(cookieData), { expires: 14 });
324+
} else {
325+
cmCookieAPI.set('consentmanager', JSON.stringify(cookieData));
326+
}
318327

319328
// Google Consent Mode v2 Update
320329
if (typeof window.GoogleConsentModeV2 !== 'undefined' && typeof window.GoogleConsentModeV2.setConsent === 'function') {

0 commit comments

Comments
 (0)