X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ftemplates%2Fapache-www.debian.org.erb;h=e1759dbb2bd6d26224ed8e39f9366d1843db00f9;hb=b806aff721e2e0bb17c52b7df5c3eb889ac1abc6;hp=e673afdeaa843becc831f0270cd754847cd9a98b;hpb=eef0d1229a8d2627ffc8663eda9bd2d68a0ef09c;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/templates/apache-www.debian.org.erb b/modules/roles/templates/apache-www.debian.org.erb index e673afdea..e1759dbb2 100644 --- a/modules/roles/templates/apache-www.debian.org.erb +++ b/modules/roles/templates/apache-www.debian.org.erb @@ -137,12 +137,16 @@ # The GDPR does not apply and to satisfy the EU cookie law we can include # some explanatory text around the form that sets the cookie. # The use of POST requests will ensure each cookie is only set explictly. + # When a cookie is set by the user, update it on every visit so it doesn't + # expire unless the user stops visiting the website for the cookie duration. # Since Apache mod_rewrite cannot inspect POST data, we use URLs instead. RewriteEngine on RewriteCond %{REQUEST_METHOD} ^POST$ - RewriteRule /intro/cn/setlang/([a-z]{2}(?:-[a-z]{2})?)/(.*) /$2 [last,redirect,cookie=lang:$1:www.debian.org:40320:/:secure:] + RewriteRule /intro/cn/setlang/([a-z]{2}(?:-[a-z]{2})?)/(.*) /$2 [last,redirect,cookie=lang:$1:%{HTTP_HOST}:40320:/:secure:] RewriteCond %{REQUEST_METHOD} ^POST$ - RewriteRule /intro/cn/unsetlang/(.*) /$2 [last,redirect,cookie=lang:invalid:www.debian.org:-1:/:secure:] + RewriteRule /intro/cn/unsetlang/(.*) /$1 [last,redirect,cookie=lang:invalid:%{HTTP_HOST}:-1:/:secure:] + RewriteCond %{HTTP_COOKIE} /^lang=([a-z]{2}(?:-[a-z]{2})?)$/ + RewriteRule . - [cookie=lang:%1:%{HTTP_HOST}:40320:/:secure:] SetEnvIf Cookie "lang=(.+)" prefer-language=$1 Header append Vary cookie