X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ftemplates%2Fapache-www.debian.org.erb;h=e1759dbb2bd6d26224ed8e39f9366d1843db00f9;hb=e9e6c1abe830ad5d653c9afd237f437fb07ee3ed;hp=2253aa7d2cfe47cd5198842700d43c8b8e99668a;hpb=3ce41982d7ff5837f7ae448258aa68465b1fd883;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 2253aa7d2..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:%{HTTP_HOST}:40320:/:secure:] RewriteCond %{REQUEST_METHOD} ^POST$ 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