To make the cookie history last forever, you can set the expiration date of the cookie to a distant future date. You can achieve this by modifying the setCookie
function call.
const handleDelete = (index) => {
const updatedHistory = [...searchHistory];
updatedHistory.splice(index, 1);
setCookie('searchHistory', updatedHistory.reverse(), { path: '/', expires: new Date('2100-01-01') });
};