On this page
What this issue is
A session is how a site remembers a visitor between pages: what is in their cart, who they are, and a security token that proves a form post is genuine. A checkout session timeout is the time after which that memory is dropped. If it is too short, the customer comes back to the page and finds the cart empty, gets 'Your session has expired', or has a payment or form submit rejected.
Why it costs you leads or sales
People pause at checkout. They look for a card, answer the door, check a coupon or switch from phone to laptop. If the session dies during that pause, they must rebuild the cart and re-enter details. Many will not. The loss is invisible in most reports because the visitor simply looks like an abandoned cart.
- Add to cartCart session starts
- Enter detailsCustomer pauses
- Session expiresToken or cart dropped
- PayError or empty cart
- Order confirmedNever reached
The customer pauses on the payment step, the session expires, and the submit fails.
Example: illustrative numbers for a store with a 10 minute timeout. Completion drops sharply once customers take longer than the limit.
How to check if your site has it
Start a real checkout
In a private window, add a product, go to checkout and fill in the details. Stop before paying.
Wait
Leave the tab open for 15, 30 and 60 minutes in separate tests. Do not touch the page.
Continue the order
Click the next or pay button. Note any 'session expired', 'invalid token', login prompt or empty cart.
Reload the page
Check whether the cart still holds the items after a reload at the same wait times.
Check cookies
In browser DevTools, open Application, then Cookies, and read the Expires column of the cart and session cookies.
How to fix it
Find which clock is shortest, then lengthen it. The fix depends on your platform.
Exclude checkout from caching
In your cache plugin, exclude the cart, checkout and account pages so forms never carry an old nonce.
Lengthen the WooCommerce session
Add the code below to a small plugin or your child theme's functions.php. The default is about 48 hours, so shorter limits usually come from a plugin or host.
Check security plugins
Some security or session plugins force logouts after a short idle time. Raise or disable the idle limit.
Know the limits
Shopify manages checkout sessions itself, so you cannot set a timeout number. Check for apps or theme code that clears the cart or forces a redirect.
Review cart-affecting apps
Disable apps that reserve stock, run countdown timers or reset the cart, then retest.
Contact Shopify Support
If the default checkout expires early with apps off, send them your test steps and times.
Look for scripts that reset state
In Preview mode, check that no custom HTML tag clears cookies, reloads the page or removes cart storage after a delay.
Check the Ecommerce settings
Checkout is handled by Webflow, so no timeout setting exists. Remove custom code that clears local storage or reloads the page on a timer.
Contact Webflow Support
If carts still empty early with custom code removed, report it with your test times.
Check Velo or custom code
Wix manages the cart session. Remove any Velo code or embeds that clear the cart or sign members out on a timer, then retest.
Check Code Injection
Squarespace manages the cart session. Look in Settings, Advanced, Code Injection for scripts that reset the cart or reload the page.
Raise the server session lifetime
Set the session cookie lifetime and server garbage-collection time to at least an hour. See the PHP example below.
Refresh tokens
Issue a new CSRF token on each checkout step and keep the cart server-side, not only in the cookie.
Check your payment provider
If you use hosted payment sessions, create them when the customer clicks pay, not on page load, or set the expiry to the maximum the provider allows.
add_filter( 'wc_session_expiring', function () {
return 6 * DAY_IN_SECONDS; // warning point
} );
add_filter( 'wc_session_expiration', function () {
return 7 * DAY_IN_SECONDS; // session ends
} );ini_set('session.gc_maxlifetime', 3600);
session_set_cookie_params(['lifetime' => 3600, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
session_start();Short timeout
- Cart empties after about 10 minutes
- Pay button returns 'session expired'
- Customer must start again
Realistic timeout
- Cart survives at least an hour
- Pay button works after a pause
- Checkout pages excluded from cache
How to confirm it's fixed
- Cart still holds items after 30 and 60 minutes idle
- Pay or Continue works after the same wait
- No 'session expired' or invalid token message appears
- Test on mobile and desktop, logged in and as a guest
- Checkout pages return no-cache headers or are excluded from caching
How to prevent it happening again
Repeat the wait test after changes to caching, security plugins, hosting, payment settings or checkout apps. Keep a note of the timeout you chose and why. Watch your analytics for orders that start checkout and then show a spike in error pages or restarts after long gaps.
How FunnelGuard handles this
FunnelGuard does not check this yet. A timed wait inside a checkout journey is a possible future check, not something it does today.
Nearby, FunnelGuard runs your real customer journeys on a schedule, such as add to cart and checkout steps, and re-checks any failure from a second region before sending one alert with a screenshot. That can show a checkout that fails to load or a step that breaks outright. It stops before payment unless your store's test mode is set up. It will not tell you that a session dies after a long pause.
Related questions
Questions people ask
Why does my checkout say session expired?
The cart, login or security token the checkout relies on timed out before the customer submitted. Common causes are a short session setting, a cached page holding an old token, or a plugin or app that clears the cart. Test by waiting on checkout and check cookie expiry dates.
How long should a checkout session last?
Long enough for a normal customer to pause and finish, so at least 30 to 60 minutes of idle time. Many stores keep the cart for days and only limit payment tokens. There is no single correct number, so choose one and test it.
Why is my cart empty after a few minutes?
The cart cookie or server session may be expiring early, or a cache, security plugin or script is clearing it. Check the cookie Expires value in DevTools and disable plugins and apps one at a time to find the cause.
Can I change the checkout timeout on Shopify?
No, Shopify controls checkout sessions and offers no timeout setting. You can remove apps or theme code that reset the cart, then contact Shopify Support with your test steps if early expiry continues.
How do I extend the WooCommerce session time?
Use the wc_session_expiration and wc_session_expiring filters to set a longer lifetime, and exclude cart and checkout pages from caching. Also check security plugins that log users out when idle.
Does page caching cause checkout session errors?
Yes. A cached checkout page can carry an expired security token, so the submit fails even though the customer was quick. Exclude cart, checkout and account pages from page caching and CDN rules.
Does FunnelGuard detect checkout session expiry?
Not yet. It is a possible future check. FunnelGuard does run scheduled checkout journeys that can reveal a checkout that fails outright, but a manual wait test is the way to check expiry today.
Related issues
- CNV-186Checkout page fails to loadFix guide
- CNV-189Checkout fields reject valid dataFix guide
- CNV-190Checkout step button disabled foreverFix guide
- CNV-191Order summary differs from cartFix guide
- CNV-196Checkout shows 'store unavailable' or password pageFix guide
- CNV-199Checkout slow (high INP on Continue)Fix guide