I have an array cookies that i want to set on cilent browsers but setcookie doesn't seem to work.I have use cookie inspector on chrome to come to this conclusion
$cookies = json_encode($cookies);
var_dump($cookies);
setcookie("test", $cookies , 0 , '/' , 'anotherdomain.com');
var_dump result
string(246) "{"PHPSESSID":"6a6326e66daf90c61656c089165bf9af","__ntt":"deleted","first_visit":"1452068874","ref_code":"__default__","usertype":"Paid-User","marketing":"{\"user_cmp\":\"\",\"user_label\":\"\"}","localization":"{\"locale\":\"en\",\"db\":\"us\"}"}" cookie set
Edit : I needed to put the var_dump after the set cookie and for simplicity i removed the another domain in the set cookie
The code now works fine but its not quite what i intended.I want to set a cookie name PHPSESSID
with value 6a6326e66daf90c61656c089165bf9af
.Similar i want to create cookies and set their value for every element in array