I am using sessions to store items in a users wish list.
The wishlist is stored as a simple array of unique item ids - An average user would store around 40 items in the wish list but it is possible that a user may wish to add as many as a few hundred items in their wish list.
I would like to generate a unique URL so that they can revisit their wishlist later, or share the wishlist with others who could use it as a starting point for their own lists.
I am not collecting any data from the user, and they will not have an account to link their wishlist data with.
The 2 methods of dealing with this that I am considering are:
Storing the data as a hash on the end of the URL, either as a url encoded serialised string or base64 encoded string. This seems preferable as I will not need to store the wishlists and this offers a large amount of flexibility for users to modify existing lists, however I suspect that this will become unworkable if the number of items in the wishlist increases and the URL length grows beyond workable character counts.
OR
Generate a url with a unique Id and save the wishlist to the database. The problem I see with this is that a new entry will be added to the database every time a user wishes to generate a URL, and since these entries won't be tied to any one user, a new entry will need to be generated every time a user makes any modification to a list.
Is there another better approach to handling this, or a way to manage the problems associated with the above methods?