When a shopper browses your store, a cookie will be save to his computer. The cookie is used to track his shopping cart. If a second shopper log on to the same computer some time later using the first shopper's account, the first shopper's cookie will be used. That's why he will see the first shopper's cart content.
In the real world, this is not a problem. Shoppers browse your store from there own computers. Even if two shoppers visit your site from the same computer, as long as they use the different accounts, they won't see each other's shopping cart.