How to store large JSON String in cookie using PHP

gzdeflate() is the best choice for your problem.

$compressedJSON = gzdeflate($json, 9);
setcookie(‘json’, $compressedJSON);

And to read it

$compressedJSON = $_COOKIE[‘json’];
$json = gzinflate($compressedJSON);