Hi - I would like to implement a feature similar to "Items you have
visited" in Amazon.
The requirement is that the feature is also available for those who
are not logged-in.
I have a User and Item models. I use Rails-default session storage.
I do not need when exactly each item page is visited, but I need to
keep the order of them
so that I can show the most recently visited item on top of the list.
Do I need to create and save every user and save the history of
visited items in the database?
Hi - I would like to implement a feature similar to "Items you have
visited" in Amazon.
The requirement is that the feature is also available for those who
are not logged-in.
I have a User and Item models. I use Rails-default session storage.
I do not need when exactly each item page is visited, but I need to
keep the order of them
so that I can show the most recently visited item on top of the list.
Do I need to create and save every user and save the history of
visited items in the database?
No. If you just save the ids of the last viewed items in an array and
keep this array short there should be no problem with the cookie-based
sessions.