make cookie auto-expire at the end of the festival

This commit is contained in:
2025-08-20 20:56:06 +02:00
parent 965ba4c80b
commit ea65f51704
3 changed files with 7 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ game_functionality: "Spielfunktionalität: Wir verarbeiten Ihre Daten, um das Ka
language_preference: "Spracheinstellung: Wir speichern Ihre Sprachwahl basierend auf Ihrer Einwilligung (Art. 6(1)(a) DSGVO), damit Sie nur einmal die Sprache einstellen müssen."
statistical_analysis: "Statistische Auswertung: Am Ende des Festivals werden statistische, nicht-personenbezogene Auswertungen über die Nutzung der Website gespeichert."
data_retention: "Datenspeicherung"
data_retention_description: "Ihre Spieldaten werden in unserer Datenbank bis zum Ende der Ars Electronica Festival Ausstellungszeit gespeichert. Die Cookies verfallen nach einem Monat oder wenn Sie Ihre Cookies löschen."
data_retention_description: "Ihre Spieldaten werden in unserer Datenbank bis zum Ende der Ars Electronica Festival Ausstellungszeit gespeichert. Die Cookies verfallen automatisch zum Festivalende oder wenn Sie Ihre Cookies löschen."
data_sharing: "Datenweitergabe"
data_sharing_description: "Wir teilen, verkaufen oder übertragen Ihre Daten nicht an Dritte. Daten werden ausschließlich für den Betrieb des Kamera-Entdeckungsspiels verwendet."
your_rights_gdpr: "Ihre Rechte unter der DSGVO"

View File

@@ -76,7 +76,7 @@ purpose_legal_basis: "Purpose and legal basis"
game_functionality: "Game functionality: We process your data to operate the camera discovery game (legitimate interest under Art. 6(1)(f) GDPR)"
language_preference: "Language preference: We store your language choice based on your consent (Art. 6(1)(a) GDPR)"
data_retention: "Data retention"
data_retention_description: "Your game data is stored in our database until the end of the Ars Electronica Festival exhibition period. The cookies expire after a month or when you clear your cookies. There is no long-term storage of any data."
data_retention_description: "Your game data is stored in our database until the end of the Ars Electronica Festival exhibition period. The cookies expire automatically after the festival or when you clear your cookies. There is no long-term storage of any data."
data_sharing: "Data sharing"
data_sharing_description: "We do not share, sell, or transfer your data to third parties. Data is used exclusively for operating the camera discovery game."
your_rights_gdpr: "Your rights under GDPR"

View File

@@ -14,7 +14,7 @@ use std::{
str::FromStr,
sync::{Arc, LazyLock},
};
use time::{Duration, OffsetDateTime};
use time::{Date, Month, OffsetDateTime, Time};
use tower_http::services::ServeDir;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use uuid::Uuid;
@@ -156,7 +156,10 @@ impl Backend {
Some(uuid) => (cookies, self.get_client(&uuid).await),
None => {
let new_id = Uuid::new_v4();
let expiration_date = OffsetDateTime::now_utc() + Duration::days(30);
let expiration_date = OffsetDateTime::new_utc(
Date::from_calendar_date(2025, Month::September, 7).unwrap(),
Time::from_hms(20, 0, 0).unwrap(),
);
let mut cookie = Cookie::new("client_id", new_id.to_string());
cookie.set_expires(Expiration::DateTime(expiration_date));
cookie.set_http_only(true);