Good afternoon,
I am creating a script that will add cookies to the user account. The problem is ... I want to add multiple cookies for example:
If the user clicks add on ad 1 he will create a cookie with ID 1. In 2 hours, if the user clicks the ad 10 he will add 1 more cookie, thus getting 2 cookies. A of ID 1 and of ID 10.
I created this like this:
if(isset($_GET['add_favorite'])) {
$favorite_id = mysqli_real_escape_string($con, sanitize($_GET['add_favorite']));
setcookie("fav_ads_ids", $favorite_id, time() + (86400 * 30), "/");
}
The problem is that it simply does an UPDATE to cookie, and that's not what I want. I want to create multiple cookies for multiple ads with the same name "fav_ads_ids".