Mobile app version of vmapp.org
Login or Join
Rambettina238

: Where is the data for items added to a shopping cart stored if not logged into the site? Sites like Amazon allow you to add items to your shopping cart without requiring you to first log

@Rambettina238

Posted in: #Datastorage #Ecommerce #ShoppingCart #WebDevelopment

Sites like Amazon allow you to add items to your shopping cart without requiring you to first log in.

My question is where do they store this data? This data still seems to be there even if you restart the browser too.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Rambettina238

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angie530

They use cookies to identify the user, and will link this to their database in order to know what is in their cart.

This can be demonstrated by how having items in your cart will not transfer between different browsers (which do not share cookies), and also how if you clear your cookies (specifically one they set called session_id), then your basket will be emptied.

The session_id cookie has an expiry date of a long time in the future, so your cart should not be emptied if you close down your browser. If it did, that would be called a session cookie.

Presumably for a logged-in user, this information is saved instead in their database.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme