$_COOKIE represents small values that the browser can send with later requests.

Cookie Values

cookie_values.php
<?php
$themeInput = ;
$_COOKIE["theme"] = $themeInput;
$theme = $_COOKIE["theme"] ?? "light";
$background = match ($theme) {
    "dark" => "black",
    "contrast" => "yellow",
    default => "white",
};

echo "theme=" . $theme . "\n";
echo "background=" . $background . "\n";
<?php
$themeInput = ;
$_COOKIE["theme"] = $themeInput;
$theme = $_COOKIE["theme"] ?? "light";
$background = match ($theme) {
    "dark" => "black",
    "contrast" => "yellow",
    default => "white",
};

echo "theme=" . $theme . "\n";
echo "background=" . $background . "\n";
<?php
$themeInput = ;
$_COOKIE["theme"] = $themeInput;
$theme = $_COOKIE["theme"] ?? "light";
$background = match ($theme) {
    "dark" => "black",
    "contrast" => "yellow",
    default => "white",
};

echo "theme=" . $theme . "\n";
echo "background=" . $background . "\n";
remembered preference Cookies are often used for small preferences such as a display theme.