Troubleshooting · Troubleshooting
How to Fix "Your Session Has Expired" in WooCommerce
Short answer
The “Your session has expired” error in WooCommerce means the checkout form could not be matched to the shopper's cart, usually because a cached checkout page served a stale security nonce. The fix is to exclude /cart/, /checkout/ and /my-account/ from every cache layer: your caching plugin, your host or server cache, and your CDN. Then purge all caches and place a full guest test order to confirm the error is gone.
Key takeaways
- A cached checkout page is the most likely cause: it serves one visitor's security nonce to everyone.
- WordPress nonces stay valid for 12 to 24 hours, so the error is rarely about time passing.
- Exclude /cart/, /checkout/ and /my-account/ from every cache layer, not just your plugin.
- Check for a cache HIT with curl -I on the checkout URL before changing settings.
- Never clear all customer sessions as a first fix: it deletes every shopper's cart.
What does “Your session has expired” mean in WooCommerce?
It means WooCommerce could not match the checkout form to the shopper's cart, so it refused the order.
The message appears when the checkout security token, called a nonce, fails its check or the cart comes back empty. WooCommerce treats both as a broken session and stops the order. The shopper must start checkout again.
The current WooCommerce release is 11.3.1, dated 19 November 2026 on its WordPress.org plugin page. Update first if your store runs an older build, then work through the fixes below.
Why does the error appear even when the shopper just loaded checkout?
It appears because the checkout page itself was stale, not because the shopper waited too long.
WordPress nonces stay valid for 12 to 24 hours by default, so a shopper who loaded checkout minutes ago cannot hit a time limit. The WordPress Developer Blog explains that WordPress measures nonce life in two 12-hour ticks, and a nonce made at the end of a tick lasts just over 12 hours.
A cached checkout page can carry a nonce made for another visitor or an earlier session. When the shopper submits it, wp_verify_nonce() returns false and WooCommerce shows the expired-session message.
The WordPress Developer Resources reference says the function returns 1 for a nonce from the first 12 hours, 2 for the second 12 hours, and false for an invalid one.
How do you reproduce the error as a guest?
Open the store in a private window, add a product, and place a test order without logging in.
- Open a private or incognito window in your browser.
- Add a product to the cart and go to checkout.
- Fill in the checkout form with test details and place the order.
- Note whether the error appears, and whether the cart empties.
Caches often skip logged-in users, so the error can vanish when you test while logged in and hit every guest. Always test as a guest, and repeat the test in a fresh private window after each fix.
If the cart itself will not hold items, the fault sits earlier in the flow. See How to Fix A Broken Add to Cart Button in WooCommerce before you chase the session error.
How do you check if a cache is serving a stale checkout page?
Run a header check on the checkout URL and look for a cache HIT on a page that must never be cached.
Run curl -I https://yourstore.com/checkout/ from a terminal and read the response headers. A cf-cache-status: HIT or x-cache: HIT value means an edge or server cache served the page instead of WordPress. A checkout page must show MISS, BYPASS, or DYNAMIC.
If the headers show a HIT, note which layer served it and move to the exclusion step below. If they show MISS or BYPASS, the cache is not the cause, so check the session cookie next.
How do you exclude cart, checkout and my-account from every cache layer?
Add /cart/, /checkout/ and /my-account/ to the exclusion list of each cache layer: plugin, server, and CDN.
WooCommerce marks the cart, checkout, and my-account pages with the DONOTCACHEPAGE constant, which caching plugins respect. Server and edge caches never see that PHP constant, so they can cache the pages anyway. That gap is why plugin settings alone do not fix the error.
| Cache layer | Where to exclude the 3 pages | What to set |
|---|---|---|
| Caching plugin | Plugin settings, cache exclusions | Exclude /cart/, /checkout/, /my-account/; see What Are the Best LiteSpeed Cache Settings for WooCommerce? |
| Host or server cache | Host panel, Varnish or nginx rules | Ask the host to bypass the 3 paths at the server layer |
| CDN or edge cache | CDN cache rules | Set Bypass cache for the 3 paths; see How to Set Cloudflare Cache Rules for WordPress |
Cloudflare's Cache Rules settings page offers a Bypass cache choice for matching requests, which is the setting to use for the three paths. Create one rule that matches any of the three paths and set its cache eligibility to Bypass cache.
After each change, purge that layer's cache and retest as a guest. Changing one layer while another still serves the stale page leaves the error in place.
How do you check whether the session cookie is reaching the shopper?
Open DevTools on the checkout page and check that the session cookie is present and stays the same across page loads.
WooCommerce stores the session in a cookie named wp_woocommerce_session_, with cart state in woocommerce_cart_hash and woocommerce_items_in_cart.
Open DevTools, go to Application then Cookies, and load the cart and checkout pages in turn. A missing cookie, or one that changes on every load, means something strips or blocks cookies.
Common causes are a web application firewall, a consent banner that blocks cookies until the shopper accepts, or a security plugin. Turn each one off in turn and retest after each change. Re-enable each one after the test so the store stays guarded.
What if the store answers on two hostnames (www and non-www)?
Pick one hostname, www or non-www, and send every visitor to it, because a cookie set for one host does not come back on the other.
Check Settings, then General, and confirm the WordPress Address and Site Address match and use the same hostname. Then check that the other hostname redirects to it with a 301 redirect. A shopper who loads checkout on one hostname and submits on the other sends no session cookie with the form.
What should you check when only logged-in shoppers see the error?
Check whether the shopper's login lapsed while checkout sat open, then have them log in again and resubmit.
A logged-in shopper who leaves checkout open for hours, or logs out in another tab, submits with a login that no longer matches the page. WordPress nonces are tied to the current user and session, so the check fails when that session ends.
The WordPress Developer Blog notes that nonces are valid only for the active user session.
Ask the shopper to log out, log back in, reload checkout, and place the order again. If the error clears, the cause was the lapsed login, not the store setup.
If the login form itself loops or refreshes, fix that first. See How to Fix a Login Page That Keeps Refreshing in WordPress for the steps.
Should you clear all customer sessions to fix the error?
No: do not clear all customer sessions as a first fix, because it deletes every shopper's cart.
WooCommerce, then Status, then Tools lists Clear customer sessions and Clear expired transients. Clearing sessions logs out every shopper and empties every cart, so use it only when WooCommerce support or your host asks for it. WooCommerce docs explain the scheduled actions found under WooCommerce, then Status, and the background tasks that run behind them.
Clear expired transients is the safer first step: it drops stale cached data without touching live carts. For a full tour of the screen, see How Do You Read the WooCommerce Status Report?.
Background order tasks run through Action Scheduler, which WooCommerce docs say sends tasks in batches of 20 across up to 5 queues at once. A short delay after clearing transients is normal, so wait a few minutes before you retest.
How do you confirm the fix worked?
Place a full guest order, from adding a product to the order-received page, and repeat it in a fresh private window.
- Purge every cache layer you changed.
- Add a product as a guest in a private window.
- Complete checkout and reach the order-received page.
- Repeat the test in a fresh private window and on a second device if you can.
Check the order in WooCommerce, then Orders, and confirm the payment matches. One success is not proof: run the same test again after an hour, when caches have had time to refill.
If the error returns after working briefly, look at the object cache. An object cache that evicts session data early can drop a session between page loads. Ask the host whether session data lives in a persistent object cache and what its eviction policy is.
When should you call your host?
Call your host when the headers still show a cache HIT after you excluded the three pages, or when you cannot reach a cache layer yourself.
Hosts control Varnish, nginx fastcgi_cache, and server-level page caches that WordPress cannot see. Ask them to confirm the three paths bypass those layers and to show you the header proof. Give them the curl output and the time the error appeared.
Also call the host if the session cookie changes on every load with all plugins off. That points to a server or proxy setting, not a plugin. A staging copy helps here: the host can test without touching live orders.
Ask the host to confirm the PHP version as well. WooCommerce lists PHP 7.4 as the minimum and PHP 8.0 as recommended, with 256 MB of WordPress memory recommended, on its WordPress.org plugin page.
What mistakes should you avoid?
Avoid clearing all sessions first, excluding only one cache layer, and testing while logged in.
- Clearing all customer sessions first, which empties every shopper's cart.
- Excluding the pages from the caching plugin only, while the host cache or CDN still serves them.
- Testing while logged in, when caches often skip logged-in users and hide the fault.
- Telling shoppers to wait less time at checkout, when the nonce lasts 12 to 24 hours and time is rarely the cause.
- Changing several settings at once, so you cannot tell which change fixed the error.
Frequently asked questions
Does the error mean the shopper waited too long at checkout?
Almost never. WordPress nonces stay valid for 12 to 24 hours, so a shopper would need to leave checkout open for most of a day to hit the time limit. When the error appears within minutes, the cause is a cached checkout page, a stripped session cookie, or a mismatched hostname.
Can a caching plugin alone cause this error?
Yes, if it caches the checkout page, but it is rarely the only layer at fault. WooCommerce marks the cart, checkout and my-account pages so caching plugins skip them. Server caches and CDNs never see that marker, so you must exclude the three pages from those layers too.
Will clearing my browser cookies fix the error?
It can fix one single shopper's session, because a fresh cookie forces WooCommerce to start a new cart. It does not fix the store. If many shoppers hit the error, the cause sits on the server side, usually a cache layer serving a stale checkout page to everyone.
Why does checkout work for me but fail for customers?
Caches often skip logged-in users, so your own tests bypass the cache while guests hit it. Test in a private window as a guest, with no login, to see what customers see. A cache HIT in the checkout response headers confirms the difference.
Does the error affect logged-in shoppers differently?
Yes. For logged-in shoppers, the error can also mean their login lapsed while checkout sat open, or they logged out in another tab. Their nonce is tied to their user session, so it fails when that session ends. Logging out, logging back in and reloading checkout fixes that case.
Sources
- Understand and use WordPress nonces properly WordPress Developer Blog
- wp_verify_nonce() WordPress Developer Resources
- Scheduled actions WooCommerce
- Cache Rules settings Cloudflare Docs
- WooCommerce WordPress.org
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
