A cart that empties between Cart and Checkout normally means WooCommerce cannot recover the same customer session on the next request. It may also be a display problem caused by cached HTML, a domain or HTTPS change, or a payment return that lands on a host using different cookies.
Do not start by clearing every WooCommerce session. Preserve one affected browser so you can see where continuity is lost.
Map the exact transition
Record the URL at product, cart, checkout and the page where the cart appears empty. Note redirects between www and non-www, HTTP and HTTPS, language paths or different domains.
Test a simple product without coupons, then compare guest and logged-in behaviour. If only one browser or device fails, inspect its cookie and consent state. If all visitors fail at the same transition, look for a shared redirect, cache or server change.
Inspect WooCommerce cookies
The browser should retain WooCommerce cart and session cookies across pages. Developer tools show the cookie domain, path, expiry, Secure and SameSite properties.
Common WooCommerce cookie names:
woocommerce_items_in_cart
woocommerce_cart_hash
wp_woocommerce_session_*
Values are sensitive session identifiers. Do not paste them into tickets, analytics or public screenshots.
A cookie written for shop.example.com will not automatically identify the same session at example.com. A Secure cookie will not travel over HTTP. Repeated redirects can therefore create a fresh session even though the pages look like one store.
Check WordPress URLs and HTTPS detection
Confirm WordPress Address and Site Address match the canonical public scheme and host. After a migration or proxy change, WordPress may believe a secure visitor is using HTTP and produce inconsistent redirects.
On a reverse proxy, HTTPS forwarding must be configured at the server level correctly. Do not blindly paste proxy constants into wp-config.php; a wrong condition can create redirect loops or weaken trust in forwarded headers.
Search the database carefully for old-domain checkout URLs, but use a serialisation-aware migration tool. Raw replacements can damage WordPress options.
Exclude commerce pages from cache
Cart, Checkout and My account require customer-specific state. Exclude their URLs plus WooCommerce AJAX endpoints from server cache, WordPress cache and Cloudflare full-page cache.
Check the response headers of a failing request for cache hits. Purging may make the symptom disappear briefly without correcting the rule, so verify an anonymous session after the cache repopulates.
Never cache pages that contain cart fragments, customer addresses or account content across users.
Trace session storage
WooCommerce stores guest session data in the database. Inspect WooCommerce system status, scheduled actions and database health. A full table, failed database write, aggressive cleanup job or object-cache inconsistency may prevent the next page from loading the saved cart.
Check logs at the exact failure time. Do not delete the session table as a diagnostic shortcut on a live store; that empties active carts and removes evidence.
Review consent and optimisation scripts
Some consent configurations block WooCommerce functional cookies until marketing consent, even though the cart cannot work without them. Classify essential commerce cookies correctly and explain their purpose.
Script delay or fragment optimisation can also show an outdated cart count. Distinguish a genuinely empty server-side cart from stale front-end markup by inspecting the checkout response and WooCommerce session.
Repair the broken boundary
Standardise the canonical host and HTTPS redirect, correct proxy handling, preserve the cookie across the required path, repair session storage and create precise cache exclusions. Change one boundary at a time and keep rollback notes.
If the loss occurs after leaving for payment, verify the gateway return and webhook URLs use the canonical domain. Do not tell customers to accept duplicate payment attempts.
Verify a complete journey
Test product addition, cart changes, checkout reload, address changes, payment cancellation and successful return. Repeat as a guest, an account user and on mobile. Confirm exactly one order, one stock reduction and one gateway transaction.
Recurring store care should test cart persistence and monitor cache-rule, DNS, SSL and domain changes. Session failures are often introduced outside WooCommerce, so the monitoring path must cover the whole request.