<?php
$data[qwerty] = "blah";
$data[1][a] = "1aa";
$data[2] = "2bb";
$data[3][c] = ";;;;;;";
$data[name][first] = "Bob";
$data[name][last] = "Jones";
$data[val] = "This is a real long test string, to see how well the compression works!";
//To Serialise Call :
$string = gzcompress(serialize($data), 9);
setcookie("my_var", $string, time()+606024*60, '/');
//print "String: $string\n<br>"; //uncomment to see serialized array
//To Unserialize Call
if (isset($COOKIE[my_var])) {
$array = unserialize(gzuncompress($COOKIE[my_var]));
echo "<pre>";
print_r($array);
echo "</pre>";
}
?>
This is what I get from the php manual.
My question is just before I updated the sever, I don't need to use the gzcompress and gzuncompress to make the above script working.
In simple words, I can directly save the serialized array value to cookie without gzcompress.
But after I update my server (apache and php both, php from php 4.3 to php 4.4), I have to use gzuncompress to save the serialized array value to cookie.
How can I re-set up my server again to make sure that I can directly save the serialized array value to cookie without gzcompress like my server did before?
There are some old sites I don't want to go back to edit the codes. They will be replaced by totally new versions soon. But for now, I need them to work without gzcompress.
Does it have to do with some size set up? Thanks!
Thanks!