Your caching plugin is installed. Your headers still say x-cache: MISS. Pages are slow even on repeat visits.
If this sounds familiar, a WooCommerce plugin is likely forcing sessions to start for every visitor — and that single cookie is bypassing your entire cache.
Here’s how to find it and fix it.
Why This Happens
Caching works by serving the same static response to multiple visitors. But when a server sends a set-cookie header — especially a WooCommerce session cookie — cache layers like Varnish, LiteSpeed, or Cloudflare treat the response as personalized and dynamic. They won’t cache it.
WooCommerce is supposed to only create sessions when a visitor actually interacts with the store — adds to cart, logs in, proceeds to checkout. But many plugins start sessions much earlier than needed, often on every single page load.
The result: your cache plugin is running, your files are being generated, but no visitor ever receives a cached page.
Step 1: Check Your Response Headers
Before anything else, check what your server is actually sending.
Open your browser’s DevTools (F12), go to the Network tab, and reload your homepage. Click the first request and look under Response Headers.
Or run this in terminal:
curl -I https://yoursite.com/
You’re looking for these red flags:
set-cookie: wp_woocommerce_session_
cache-control: no-store, no-cache
x-cache: MISS
If wp_woocommerce_session_ appears in the cookie header on your homepage — before any shopping activity — something is creating WooCommerce sessions prematurely.
Run it twice. If the second request still shows x-cache: MISS, your cache isn’t working at all for anonymous visitors.
Step 2: Use Query Monitor to See What’s Running
Install the free Query Monitor plugin and reload your homepage.
Go to Hooks & Actions and look for entries like:
WC_Session_Handler->maybe_set_customer_session_cookie()
WC_Cart_Session->maybe_set_cart_cookies()
If you see these firing on a page where no cart interaction has happened, WooCommerce sessions are being started unnecessarily.
This confirms the issue — now you need to find which plugin is responsible.
Step 3: Search Your Plugin Files
Run these searches in your plugins folder:
grep -R "set_customer_session_cookie" wp-content/plugins --include="*.php"
grep -R "WC()->session" wp-content/plugins --include="*.php"
grep -R "WC()->cart" wp-content/plugins --include="*.php"
Make a list of every plugin that shows up. Common offenders include:
- Quote request plugins
- Currency switchers
- Cart abandonment tools
- Loyalty and rewards plugins
- B2B or wholesale plugins
- Certain payment gateway plugins
Step 4: Disable Plugins One by One
Start with the most likely suspects from your search results.
After disabling each one, run:
curl -I https://yoursite.com/
curl -I https://yoursite.com/
Check whether wp_woocommerce_session_ disappears from the cookie header, and whether the second request returns x-cache: HIT.
When you find the plugin that causes the cookie to disappear, you’ve found the culprit.
Step 5: Fix or Replace the Plugin
Once you’ve identified the plugin, you have a few options:
Contact the developer. The session should only be initialized when a user interacts with the relevant feature — not on every page load. This is a fixable bug, and many developers will patch it if you report it clearly.
Check for a setting. Some plugins have options to control when they initialize. Look for settings related to “session handling,” “cart initialization,” or “cookie behavior.”
Consider an alternative. If the plugin is abandoned or the developer doesn’t respond, look for an alternative that handles sessions more responsibly.
Add a workaround via code. In some cases, you can unhook the problematic function and re-hook it only on relevant pages (cart, checkout, specific shortcodes). This requires PHP knowledge or developer help.
Quick Reference: What Good Headers Look Like
After fixing the issue, your second request to any non-cart page should look something like:
x-cache: HIT
age: 45
cache-control: public, max-age=3600
No wp_woocommerce_session_ in the cookie header for anonymous visitors on non-cart pages.
The Bigger Picture
This issue silently kills performance on a lot of WooCommerce stores. The caching tools get the blame, but they’re usually doing exactly what they’re supposed to. The real problem is a plugin that doesn’t know when to stay quiet.
If you’ve upgraded your hosting, switched cache plugins, or spent hours tweaking settings without improvement — check your headers first. A 30-second inspection might tell you everything you need to know.
