How to filter content on a view page using cookies? I'm developing a website where users access the content without registration but it still needs to have a favorites system for the elements on the web.
Right now I have implemented a system where i can add items to a "favorites" and the node id for every item is saved on a cookie. 
Is there a way to filter the items that are shown by a view page using this node ids saved on the cookies? 

I thought that it can be done by altering the query sent by the view or by aplying a filter in some point of the process where i check whether the element returned by the view corresponds with the node id saved in the cookie.

Is any of this options feasible? Is there a simpler way to focus this problem?
A better way to tackle your problem might be the Flag module.

It also has a good views integration and is quite easy to set up.

Just add a "favorites" flag and set it as private flag, so every user can have its own favorites.

On your favorites-view set your filter criteria to match the flag and you are good to go.