With the shopping cart example, I'm not sure I understand how session identity can be preserved if I clear my local storage/cookies?
There's a (K,V) pair somewhere, but in order to get V, you need K, which you've lost.
You could also store carts by session id until they're logged in, and then store the carts by account id when they are.
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.