What happens when a customer adds items to their cart but decides not to check out right away, or accidentally closes the tab with the Flipbook? Do they automatically lose the contents of their basket?
Well, we have good news!
Technically, basket contents do not expire and will be stored indefinitely. This is the browser stores these basket contents in the localStorage
, which is a property that allows JavaScript sites and apps to save key-value pairs in a web browser with no expiration date.
To put it simply, this means the data stored in the browser will persist even after a customer closes the browser window.
I've checked, but my basket contents were cleared after some time, why is that?
As we mentioned above, technically, basket contents can remain in the basket forever. However, certain conditions can arise, which results in the basket emptying:
Website cookies can expire, or a user can clear these, along with temp files from the browser
A user changes the Settings in the browser that affect
localStorage
Furthermore, if the browser does not support localStorage
, or the user has disabled the use of localStorage
, it is then the browser that determines how long basket contents are stored before being purged.
We hope this answers your questions about basket contents and localStorage! Still have questions? Get in touch with us, and we'll be happy to help. 😀