set lang cookie with strict SameSite property

This commit is contained in:
El RIDO 2024-04-21 11:36:31 +02:00
parent 15481290fb
commit 658383e6d1
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
5 changed files with 6 additions and 6 deletions

View file

@ -178,7 +178,7 @@ class Controller
// force default language, if language selection is disabled and a default is set
if (!$this->_conf->getKey('languageselection') && strlen($lang) == 2) {
$_COOKIE['lang'] = $lang;
setcookie('lang', $lang, 0, '', '', true);
setcookie('lang', $lang, array('SameSite' => 'Strict', 'Secure' => true));
}
}
@ -389,7 +389,7 @@ class Controller
$languageselection = '';
if ($this->_conf->getKey('languageselection')) {
$languageselection = I18n::getLanguage();
setcookie('lang', $languageselection, 0, '', '', true);
setcookie('lang', $languageselection, array('SameSite' => 'Strict', 'Secure' => true));
}
// strip policies that are unsupported in meta tag