Common causes
- Cart, checkout or My Account pages being cached by a plugin, host cache or CDN
- The wp_woocommerce_session_ cookie being stripped or set for the wrong domain (www vs non-www)
- A security or cookie-consent plugin blocking WooCommerce's cookies
- The woocommerce_sessions table is corrupted, full or not writable
- Checkout nonce failing because the checkout page HTML was cached
- Mixed HTTP/HTTPS URLs causing secure cookies to be dropped
How to fix it
- Exclude WooCommerce pages from caching. In your cache plugin, host cache (LiteSpeed, Varnish, Nginx FastCGI) and CDN, bypass /cart/, /checkout/, /my-account/ and any request with woocommerce_items_in_cart or wp_woocommerce_session_ cookies.
- Check the site URL and SSL. Ensure Settings > General uses one https:// URL that matches the address customers use, and redirect the other host variant.
- Clear WooCommerce sessions. Go to WooCommerce > Status > Tools and run 'Clear customer sessions'. Note this empties all current carts.
- Check the sessions table. In phpMyAdmin run CHECK TABLE on wp_woocommerce_sessions and repair if needed; database errors in debug.log often point here.
- Disable conflicting plugins. Test with only WooCommerce and a default theme active (Health Check troubleshooting mode). Cookie-consent, security and minification plugins are common culprits.
- Review WooCommerce logs. Check WooCommerce > Status > Logs for fatal-errors and payment gateway logs from the time of the failure.
WP-CLI
wp db query "CHECK TABLE wp_woocommerce_sessions;"
wp db query "SELECT COUNT(*) FROM wp_woocommerce_sessions;"
wp cache flush How to stop it happening again
- Keep cart, checkout and account pages permanently excluded from all caches
- Test checkout as a guest after every caching or CDN change
- Make sure WP-Cron runs so expired sessions are cleaned regularly