i want to store an array of strings in a PHP cookie example :
$array = array("1", "test");
setcookie($cookie_name, $array, time() + (86400 * 30), "/");
$array = array('a'=>"1", 2=>"test", 25);
$json = json_encode($array);
setcookie('name', $json);
array = json_decode($_COOKIE['name']);
You can parse it into a string (e.g. http_build_query($array) or serialize) and store it in the cookie and then again to read from it you can parse the string (e.g. str_parse($_Cookie['cookie']) or deserialize).