I have a website with a listing, and the user can add items to favorites. I am using at the moment the setState command to save all the favorite information, but it will keep it just until the browser closes and the session ends.
I want to keep that information saved forever into a cookie, I know I can set allowAutoLogin to true to save user information into cookies, but the point is that users on my website don’t have an account so that will not work.
I must allow unregistered users to add items to favorites so they can see them again when re-visiting the website.
I am looking at the CHttpCookie but I don’t understand very well how it works, can anyone post an example or another way to accomplish the functionality that I need?
Thank you for the recommendation I will try to understand how cookies work in Yii and save just an identifier of the user there, then all the data in the database.
I could not find a good simple example but got inspired from many posts and finally this works, maybe it needs more improvments but at the moment it solves my needs!