For example, if the user clicks a button next to a product with the ID - 12345, the cookie value would contain: 12345
If the user then clicked on a button next to product ID 5678, the cookie value would contain: 12345, 5678
As a user clicks the button, this results would update (refresh and re-read the cookie value) without reloading the page.
The last piece would be enabling a "delete" icon next to each result which would update the cookie value and remove that specific ID from the string of values.
This is basically enabling a light-weight save feature on my site.
If you agreed to help with this, ideally I would receive a JS file with functions that set and update the cookie, some HTML & JS for the results displayed on the page.