4 ms·
The shopping cart is still stored somewhere, but when the user has cleared their cookies, etc., what information do you have that will let you it's their shoppi
by adrianmonk 8y ago
The shopping cart is still stored somewhere, but when the user has cleared their cookies, etc., what information do you have that will let you it's their shopping cart so you can find it again?
There's a (K,V) pair somewhere, but in order to get V, you need K, which you've lost.
- zackbloom 8y agoIt would work just as most shopping carts do I imagine. You could store a session id in a cookie, and then use the data in KV to map that session id to a user account (if they're logged in) and their cart. So you would have a namespace full of sessions, and a namespace full of carts. You could also store carts by session id until they're logged in, and then store the carts by account id when they are.
- adrianmonk 8y ago> You could store a session id in a cookie But the person you responded to asked what happens after "I clear my local storage/cookies". So you don't have access to the session id. It was in a cookie that is now gone.