Use WP_Query Data In Cookie
You could try serializing the array so that it becomes a flattened textual representation of the values it contains. e.g. $testArr = [3,4,”test”, 56]; echo serialize($testArr); gives: a:4:{i:0;i:3;i:1;i:4;i:2;s:4:”test”;i:3;i:56;} However, you should probably consider using user sessions for this rather than cookies.