how can i make this code work with cookie? I would like it to last longer with the cookies, the session only last for a short period of time
if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) {
// RUN IF THE CART IS EMPTY OR NOT SET
$_SESSION["cart_array"] = array(0 => array("item_id" => $pid, "quantity" => 1));
setcookie("id", $_SESSION["cart_array"], strtotime( '+1 day' ), "/", "", "", TRUE);
setcookie("quantity", "1", strtotime( '+1 day minute' ), "/", "", "", TRUE);
}
any tips, hints or advice are acceptable as always. HELP PLEASE