This is an associative array containing all the cookies passed from the browser in the last request.
<?php
session_start();
@print "Setting cookie #" . ++$_SESSION["j"] . "<br>";
setcookie("testcookie", "cookie " . $_SESSION["j"]);
if (isset($_COOKIE["testcookie"])) {
print "Testcookie received: " . $_COOKIE["testcookie"];
}
?>Setting cookie #7
Testcookie received: cookie 6 Reload the page several time to see how it works. When a cookie is updated, the value will not be available until the next request. For more information about set_cookie(), see the section about Cookies and Sessions.