I know the method of storing the data in php.
But this method doesn’t work when I am storing a long array in PHP.
That array has about 3000 values (82382 characters).
I am doing this:
$encoded_db_data = base64_encode(serialize($query_result));
setcookie("db_select_result", '$encoded_db_data');
but db_select_result is printing blank (no value). How can i solve this problem?
From: http://www.faqs.org/rfcs/rfc6265.html
Consider the next options:
1.Split the array’s data and put it in more than one cookie.
2.Use
sessions(Unlike cookies they have “short-life”) [http://www.php.net/manual/en/session.examples.basic.php]3.Store that data in a
Databasewith a “unique key” , then set a cookie with thatunique key so you’ll be able to identify which data to pull from the database.
4.Use less data from your array and try to put it in a cookie.