Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Cart empties after page reload: how to find and fix it

PRF-242High impactDetectedBy FunnelGuardPublished Updated
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.

Where the sale is lost
  1. Add to cartItem is added and cart ID is set
  2. Reload or next pageCart cookie not sent or cached page served
  3. Cart shows emptyVisitor sees 0 items
  4. CheckoutNever reached

The cart ID is dropped on reload, so everything after it is lost.

Visitors who reach checkoutExample numbers
Visitors who reach checkout (example)Cart keeps items: 60 % of add-to-cart sessions; Cart empties on reload: 12 % of add-to-cart sessions023466012Cart keeps itemsCart empties on reload% of add-to-cart sessions

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

Manual test in about five minutes
  1. 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.

  2. 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.

  3. Inspect the cookie

    In Chrome DevTools open Application > Cookies. Look for the cart cookie (for example cart on Shopify or woocommerce_cart_hash and woocommerce_items_in_cart on WooCommerce). Note its domain, expiry, SameSite and Secure values.

  4. 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.

  5. 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.

What the visitor sees

The item is added, the page reloads and the basket is empty.

How to fix it

Fix by platform
  1. 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_cart or wp_woocommerce_session_* exist. WooCommerce usually adds these rules itself, but custom setups and CDNs often miss them.

  2. 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.

  3. 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.

Example headers for a cart cookie and cart pagestext
Set-Cookie: cart_id=abc123; Path=/; Max-Age=1209600; Secure; HttpOnly; SameSite=Lax
Cache-Control: private, no-store

How to confirm it's fixed

Retest checklist
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: cart_persists (Stage 29): the cart page is reloaded once and read again.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.