Sorry, your session has expired 📝 WordPress

WooCommerce: Sorry, your session has expired. Return to shop

WooCommerce lost the customer’s cart session — usually because checkout/cart pages are cached or cookies are blocked/stripped.

Seen on: WordPress

Meaning

Cart, checkout and My Account must never be cached. CDNs/page caches that strip cookies or serve cached pages, and session cleanup issues, cause empty carts and this message.

Common causes

  • Cart/checkout pages cached (page cache/CDN)
  • CDN stripping woocommerce cookies
  • Mixed domain (www/non-www) cookies
  • Session table cleaned prematurely

⚡ Quick fix

  1. Exclude cart, checkout and my-account from all caching
  2. Bypass cache when woocommerce_items_in_cart cookie is set
  3. Keep one canonical domain

Detailed fix by platform

Nginx

  1. if ($http_cookie ~* "woocommerce_items_in_cart|wp_woocommerce_session_") { set $skip_cache 1; }

How to diagnose

  1. Cache — Checkout cached? (response headers)
  2. Cookies — Set and returned?
  3. Domain — Consistent?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.