使用良好的开发实践,是否应该在设置后检查是否存在setcookie
,或者是否知道设置为 100%?谢谢你。
<?php
require "includes/settings.php";
require "functions/php_function_library.php";
$item_id = $_REQUEST['item_id'];
$item_qty = $_REQUEST['quantity'];
echo $item_id;
echo $item_qty;
$cookie_guid = guid();
setcookie("anonymous_cart", $cookie_guid);
#check that the cookie I just set exists?
#insert new cart record into DB
...
?>