// Therefore the get parameter defined above should be used until then.
// if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe' ) {}
if ($enableSameSiteFix && AdvancedIframeCookie::isSecure()) {
foreach (headers_list() as $value) {
if (AdvancedIframeCookie::aiStartsWith($value, "Set-Cookie")) {
if (AdvancedIframeCookie::isSameSiteCookie($value, $filterArray)) {
if (!AdvancedIframeCookie::aiContains($value, "Secure")) {
$value .= '; Secure';
}
if (!AdvancedIframeCookie::aiContains($value, "SameSite")) {
$value .= '; SameSite=None';
}
if (!AdvancedIframeCookie::aiContains($value, "Partitioned")) {
$value .= '; Partitioned';
}
}
// The first cookie replaces all existing ones
// https://www.php.net/manual/de/function.header.php -> See replace
// All the others are appended
if ($first) {
header($value);
$first = false;
} else {
header($value, false);
}
}
}
if ($debug) {
echo 'SameSite cookie fix applied...
';
}
} elseif ($debug) {
echo 'SameSite cookie fix is not applied...
';
}
if ($debug) {
echo 'headers list:
';
echo '