To clarify the previously posted note:
Dots (.) and spaces ( ) in cookie names are being replaced with underscores (_).
PHP - Manual: $_COOKIE
2024-12-23
To clarify the previously posted note:
Dots (.) and spaces ( ) in cookie names are being replaced with underscores (_).
beware, dots (.) in cookie names are replaces by underscores (_)
$_COOKIE returns an array if there are more than one cookie saved under the given key.
Cookies with the same name the first cookie is used. Clients will send cookies with longer path before cookies with shorter path. This comes from RFC 6265 which says "Cookies with longer paths are listed before cookies with shorter paths.". So you get the best matching cookie for your current request.
官方地址:https://www.php.net/manual/en/reserved.variables.cookies.php