Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I want to allow users to add images displayed on my index.html page to favorites and store them in a page called favorites.html using just cookies with no login or account required. It's like a shopping cart system but with no checkout.

I searched for this on google but I didn't find any related topic. Although there are websites that have a favorites system without login or account.

Any idea from where I should start?

What I have tried:

I tried to use a shopping cart system and then remove the chechout/price/quantity but no success
Posted
Updated 29-Mar-21 2:21am
v2

1 solution

Use localStorage[^] instead of cookies.

Cookies would be sent to the server with every request, and thus have a very small size limit. Local storage is never sent to the server (unless you write code to do so), so you can store much more data in it.

Local storage is also much simpler to work with than cookies.
Using the Web Storage API - Web APIs | MDN[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900