On this page
What this issue is
A shop remembers a basket by storing a small ID in the visitor's browser (a cookie) or in browser storage, and matching it to a cart on the server. If that ID is missing, changed or ignored when the page reloads, the shop treats the visitor as new and shows an empty cart.
Common causes: a page cache serving the same cached cart to everyone, or an empty one; a redirect between example.com and www.example.com (cookies do not carry across different hosts); cookies set with the wrong SameSite, Secure or domain value; a checkout hosted on another domain; browser privacy settings or consent tools blocking storage; and a plugin or theme script that clears local storage.
Why it costs you leads or sales
The visitor has already decided to buy. When the basket vanishes, many will not rebuild it. They leave, and you also lose the abandoned-cart data that email reminders and remarketing rely on. It often shows up only for some visitors (one browser, one device, in-app browsers), so it is easy to miss.
- Add to cartItem is added and cart ID is set
- Reload or next pageCart cookie not sent or cached page served
- Cart shows emptyVisitor sees 0 items
- CheckoutNever reached
The cart ID is dropped on reload, so everything after it is lost.
Example: illustrative numbers only. If the cart empties on reload for a share of sessions, fewer of them reach checkout.
How to check if your site has it
Add an item in a clean browser
Open a private window, visit a product page and add it to the cart. Do not log in.
Reload and navigate
Press reload on the cart page, then go to another page and back. Also try the www and non-www versions of your address.
Inspect the cookie
In Chrome DevTools open Application > Cookies. Look for the cart cookie (for example
carton Shopify orwoocommerce_cart_hashandwoocommerce_items_in_carton WooCommerce). Note its domain, expiry, SameSite and Secure values.Watch the network tab
On reload, check the request headers in Network. The cart cookie should be sent. If it is sent but the cart is still empty, suspect caching or server session storage.
Repeat on mobile and other browsers
Test Safari on iPhone, Chrome on Android and an in-app browser (open your link from Instagram or Facebook). Also test with your consent banner rejected.
The item is added, the page reloads and the basket is empty.
How to fix it
Exclude cart pages from caching
In your caching plugin or host cache, exclude /cart/, /checkout/ and /my-account/ and bypass the cache when the cookies
woocommerce_items_in_cartorwp_woocommerce_session_*exist. WooCommerce usually adds these rules itself, but custom setups and CDNs often miss them.Match the site address
In Settings > General, make WordPress Address and Site Address use the same host (www or non-www), then redirect the other one.
Test for plugin conflicts
Switch to a default theme and disable plugins one by one (on a staging copy) to find one that clears sessions or cookies.
Check domains
In Settings > Domains, set one primary domain and redirect the others to it, so shoppers do not switch hosts mid-visit.
Review theme and app code
Look in the theme code and installed apps for scripts that call
/cart/clear.jsor remove thecartcookie. Test with the apps disabled or on a duplicate theme.Check headless or custom storefronts
If you use a custom front end, store the cart ID and keep it in a cookie or local storage on every page.
Look for tags that touch storage
Search your container for Custom HTML tags that clear cookies, call
localStorage.clear()orsessionStorage.clear(). Use Preview mode to see which tag runs on reload.Pause the tag and retest
Pause the suspect tag in Preview, repeat the test, then fix or remove it.
Check the Ecommerce cart settings
Webflow Ecommerce keeps the cart in the browser. Publish to your custom domain, not only the webflow.io address, and set a single default domain with the other redirected.
Review custom code
In Site settings > Custom code, remove any script that clears local storage or cookies.
Keep the funnel on one domain
Use the same custom domain for the store, the cart and the checkout steps. Switching between a subdomain and the default domain starts a new session.
Check custom code
Review header and footer tracking code for scripts that reset storage.
Use the connected primary domain
In Domains, set one primary domain so shoppers are not sent between the wixsite.com address and your own domain.
Remove custom scripts
Check Settings > Custom code for scripts that clear storage, then retest with them off.
Set one primary domain
In Settings > Domains, choose a primary domain so other addresses redirect to it.
Review code injection
In Settings > Advanced > Code Injection, remove scripts that clear cookies or storage.
Set the cookie correctly
Use a stable cart ID cookie with a sensible expiry,
Path=/,SecureandSameSite=Lax.Never cache cart responses
Send
Cache-Control: private, no-storeon cart pages and cart API responses, and vary caches on the cart cookie.Keep one host
Redirect www and non-www to one host with a 301 before any session starts.
Set-Cookie: cart_id=abc123; Path=/; Max-Age=1209600; Secure; HttpOnly; SameSite=Lax
Cache-Control: private, no-storeHow to confirm it's fixed
- Cart keeps items after reload in a private window
- Cart survives moving between product, cart and checkout pages
- Both www and non-www end on the same host
- Cart cookie keeps the same value across page loads
- Works on Safari iPhone, Chrome Android and an in-app browser
- Works with the consent banner accepted and rejected
- Cart page response has no-store or private caching headers
How to prevent it happening again
Repeat the add, reload and navigate test after every theme change, plugin update, caching or CDN change, domain change and new tracking script. Keep a short written test script so anyone on the team can run it. Check the cart cookie settings in DevTools whenever a release touches checkout.
How FunnelGuard handles this
FunnelGuard does not check for this yet. A cart that empties on reload is a possible future check. Today FunnelGuard does run your real customer journeys on a schedule (such as add to cart and checkout buttons), so a broken step or a page that fails to load can show up as a failed journey, with a screenshot and a likely cause. It does not specifically test whether the cart survives a reload.
Until then, run the manual test above after each release, and compare add-to-cart and begin-checkout counts in your analytics. A widening gap between them is a sign to test the cart again. FunnelGuard offers a free read-only website audit, and the Free plan covers 1 site and 2 journeys with daily checks.
Questions people ask
Why does my cart empty when I refresh the page?
The site is not matching your browser to its saved cart. Typical causes are a blocked or missing cart cookie, a page cache serving a stale cart, or a redirect that changes the domain. Check the cart cookie in DevTools and see whether it is still sent on reload.
Why do items disappear from my WooCommerce cart?
Most often a caching plugin or CDN is caching the cart, checkout or account pages, or a plugin clears the session. Exclude those pages from caching and bypass the cache when the WooCommerce cart cookies exist. Then test with plugins disabled on a staging copy.
Why is my Shopify cart empty after changing pages?
Look for several domains in use, or a theme or app script that clears the cart. Set one primary domain under Settings > Domains and test with apps disabled. Custom storefronts must store the cart ID on every page.
Can www and non-www cause an empty cart?
Yes. Cookies set for one host are not sent to the other unless the cookie domain is set to cover both. Redirect one version to the other so shoppers stay on a single host.
Can a cookie banner empty the cart?
It can if the banner blocks the cart cookie or storage until consent is given. Cart cookies are usually needed for the shop to work, so check how your consent tool categorises them, and test with consent rejected.
Why does the cart only empty on iPhone or in Instagram?
Safari and in-app browsers apply stricter storage rules, and some limit cookies across domains. This is often a cross-domain checkout or a cookie with the wrong SameSite setting. Test on real devices and keep the cart and checkout on one domain.
Does FunnelGuard detect carts that empty on reload?
Not yet. It is a possible future check. FunnelGuard does run your journeys on a schedule and reports failed steps, so a broken cart step may fail a journey, but it does not specifically test cart persistence.
Related issues
- PRF-230Back button loses form/cart stateFix guide
- PRF-229Back button broken (history hijacked, redirect loop)Fix guide
- PRF-220No thank-you/confirmation after submitFix guide
- PRF-231Rage-click areas (elements that look clickable but aren't)Fix guide
- PRF-208Main CTA not visible without scrollingFix guide
- PRF-209No clear CTA on landing pageFix guide