setcookie("test_cookie", "test", time() + 3600, '/');
<html>
<body>
if(count($_COOKIE) > 0) {
echo "Cookies are enabled.";
} else {
echo "Cookies are disabled.";
}
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_http_setcookie5 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:22:57 GMT -->
</html>