I get an unneeded number combination.
($_COOKIE):
2, 3, 4, 5, 6, 7, 8, 901234567890123456789, 30
Should be ($_COOKIE):
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12... (till) 30
$_Get['id']="1"; (sorry, forgot to post it.)
Why that happens?
The code:
<?
ob_start();
$id=$_GET['id'];
if (!empty($id)){
$id=str_replace('a9_','', $id);
$value=$_COOKIE['NaudingasURL'];
$exp = explode(", ", $value);
if(in_array($id, $exp)){
$value2=str_replace(', '.$id,"", ', '.$value);
$value2=substr($value2, 2, strlen($value2));
echo'r';
}
else{
$value2=$value.', '.$id; echo'a';
}
setcookie("NaudingasURL", $value2);
}
ob_end_flush();
?>
I'm calling it with Jquery ajax, but I don't thinks that's the problem.