The empty box usually doesn't see the same session as the next request, but the reason can be a redirect between domains, a disabled cookie, a personal response cache, or a session storage failure. If only the cart badge is zero but the Cart page has goods, it's a display and fragment issue; don't know the two scenarios.
Quick answer:Add a product with an anonymous browser and save the hostname, scheme, redirect, and metadata of the cookie at all stages. Open the cart directly and check the cache response. Then see the PHP/WooCommerce log, disk space, and backend session. Do not publish the amount of the cookie.
The pattern of emptying is the main clue.
- After the next page: domain/path cookie or cache
- After entering: merge the casket or add membership
- In the checkout: redirect, HTTPS or hook
- After a few minutes: expiration or cleanup.
- Mobile only: cache variation or browser privacy
- Only certain users: consent, extension or specific node
Connect the domain and HTTPS
Moving between domains with and without www or HTTP and HTTPS may change the scope of the cookie. See redirect chain from product to checkout. In reverse proxy, an incorrect HTTPS detection can corrupt a secure cookie or URL. Do not change your WordPress address without backup and proxy recognition.
Check the cookie safe.
In DevTools, check the name, domain, path, expiry, Secure, and SameSite. The consent tool should not accidentally block or delete the cookie that is essential to the cart. Compare the behavior of the unknown window, second browser, and login mode.
Cache personal response
Cart, Checkout and My Account should be outside the public cache page. The presence of a WooCommerce cookie should also be considered in the bypass. For the browser, CDN, reverse proxy, and plugin, check hit/miss separately.
Session to the server.
A database error, improper cleanup, large table, or failed write can make the session unavailable. Match the log with the timestamp and open Cart. Do not truncate the table or group the sessions; active user purchases will be damaged.
Multiple nodes and load balancers
In multiple nodes, the session store and cache must be shared and compatible or the sticky session must be deliberately designed. The difference between secret, clock, or deployment between nodes causes the problem to alternate.
Disk space and Write error
df -h
df -i
These are read-only. Full disk or inode can disrupt session and cache. Do not blindly delete active database or log files; find the user and correct retention.
In and Merge box
If it only happens after login, compare the request and cookie before and after authentication. Check the wishlist, membership, SSO and external redirect plugins. Callback to another hostname can create a new session.
Expiration, server clock and cleanup.
If the cart is empty after a certain distance, match the session expiration and cleanup execution time to the system clock and database. Do not know the difference in display timezone with the actual clock. Reducing or increasing TTL too much is not a detection; retention should be consistent with the purchase experience, privacy and storage capacity.
Cache key checking without user disclosure
In staging with two independent browsers, add a different product to each box and compare responses. If the content of one session appears in another, immediately block the public cache for dynamic path. For reporting, just enter a hash or test ID and do not keep the actual client cookie.
Deployment and incompatible versions
If the problem starts after the update, check the schema session, template override and compatibility of WooCommerce. Rollback files can cause incompatibilities regardless of the database migration; specify the previous version first on the test data clone and the new order saving path.
The phase test.
- Choose a simple product and an unknown browser.
- After you add it, open the Cart straight.
- Enter the hostname and redirect.
- Compare the cookie and the cache header.
- Repeat with login and second browser.
- Log and storage are the same time.
- First publish the correction on staging.
If only the mini-car was empty.
It may be a healthy session and a fragment of stale format. Compare Cart and endpoint fragment pages and check Console.Product add-on guideIt helps to separate the backend and UI.
Common Mistakes
- Caching Cart and Checkout
- Delete all sessions during sales hours.
- Change the time of the domain, HTTPS and cache
- Send real cookies to the public ticket
- Ignoring consent and SSO
- Delete unidentified files to free up disk
Approval of the amendment
The cart should be kept in navigation, refresh, authorized login and checkout. At the same time, make sure that the cart is not moved. Expiration and logout should also be expected to behave.
When do you need special assistance?
If the problem is recursive, node-dependent or with another user's trunk display, security is a priority.Support for the WooCommerceIt can scan cookies, session stores, cache keys and proxies without deleting data.
Common Questions
Does Redis cause the basket to empty?
Not necessarily Redis itself; check the namespace, eviction, TTL and invalidation.
Why does it only happen after the entry?
Check the merge box, account cookie, SSO and domain redirect.
Is deleting sessions the solution?
No, it eliminates active users and doesn't fix the cause.