Why not just create an array:
$myArray[time()] = $searchterm;
Of course, you'd have to use [man]count/man to see if there were already 20 items in the array and, if so, [man]unset/man the earliest timestamp.
After you do all that, you'd store the entire array in the cookie using [man]serialize/man. On the next page when you want to re-create the array in PHP, you'd of course use [man]unserialize[/man].
EDIT:
OahuRE wrote:although a cookie can't do an array
Aha, there's where you're wrong. Guess we posted at the same time :p