Many online retailers allow you to add items to a basket prior to checkout.
Some of the big 'names' have a smart strategy that combine baskets and wishlists, and notify you on a future visit if an item in your basket has changed in price since you added it. That's something of an ideal which is rarely used by smaller retailers.
But more often, retailers often simply let the contents of the basket time out after say 24 hours of inactivity. I suspect often that is down to a few factors such as
- implicit (or explicit) acceptance of a default setting on the e-commerce cart framework
- lack of knowledge or consideration by the business
- non communication between web developers and business
There may be some business rules that affect how long certain things are in the basket for - eg one off items no longer available, or there may be a benefit to logging in or registering in that the basket is retained for longer when logged in.
My instinct is that basket contents should remain more or less indefinitely, but I feel there must be other considerations that might affect the UX and that it's not as simple as that.
Given that type of product does not dictate length of time in basket, and irrespective of being logged in or not, how long should basket contents remain before it is automatically cleared.