Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Session cookie lost between steps: how to find and fix it

CNV-376High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

A session cookie is a small piece of data your browser stores and sends back with every request. The server uses it to recognise the same visitor across pages. It holds things like a cart ID, a login or the answers from step 1 of a form.

The cookie is 'lost between steps' when the browser does not save it, does not send it on the next request, or the server replaces it with a new one. The site then treats the visitor as new. Nothing looks broken on screen until the visitor reaches the step that needs the data.

Common causes: a cookie set on www.example.com but the next step is on example.com; a checkout on another domain or subdomain; a Secure cookie set over plain HTTP; a wrong SameSite value; a caching layer that strips Set-Cookie; and a redirect that sends the visitor to a different host.

Why it costs you leads or sales

The visitor has already decided to act. They add to cart, fill step 1 and click next. If the cart is empty or the form restarts, most will not start again. Because the page still loads, you get no error, only fewer conversions.

Where a lost session cookie breaks the funnel
  1. Product pageSession cookie set
  2. Add to cartCart saved to session
  3. CheckoutCookie not sent, cart empty
  4. PaymentNever reached
  5. Thank-you pageNo purchase tracked

The cookie is set on the product page but dropped when the visitor moves to checkout.

Visitors reaching each stepExample numbers
Visitors reaching each step (example)Add to cart: 100 visitors; Checkout with cookie kept: 70 visitors; Checkout with cookie lost: 15 visitors038771007015Add to cartCheckout with cookie …Checkout with cookie …visitors

Example: 100 visitors add to cart. With the cookie lost at checkout, almost none can continue.

How to check if your site has it

Trace the cookie through your funnel
  1. Open a clean window

    Use a private window with no extensions so old cookies do not hide the problem.

  2. Open dev tools

    Press F12, go to Application (Chrome, Edge) or Storage (Firefox), and select Cookies for your domain.

  3. Start the journey

    Add a product to the cart or complete step 1 of the form. Note the session cookie name and value (for example PHPSESSID, woocommerce_cart_hash, a platform cart token or your own).

  4. Move to the next step

    Check whether the same cookie is still there with the same value. Also look at the host in the address bar: did it change between www and non-www, or to another domain?

  5. Inspect the response headers

    In the Network tab, click the request for the next step. Look at Set-Cookie in the response and Cookie in the request. A new Set-Cookie with a new value means the session was reset.

  6. Check the warning icons

    In the Network tab, a yellow warning on a cookie shows why the browser blocked it, such as a SameSite or Secure problem.

What you see and the likely cause
What you seeLikely cause
Cookie present on step 1, missing on step 2Host or domain changed, or cookie Path too narrow
New cookie value on every pageCache stripping Set-Cookie, or server not reading the cookie
Cookie flagged as blocked in Network tabSameSite or Secure flag mismatch
Works on desktop, fails in an in-app browserThird-party cookie limits or an iframe
Fails only after a redirectRedirect goes to a different host or protocol
Step 2 loads, but the session is gone

The page does not show an error, but the data from step 1 is missing.

How to fix it

Fix the cause you found. The settings below cover the most common ones. Menu names vary by theme and plugin version.

Fix by platform
  1. Make the site address consistent

    In Settings > General, make WordPress Address and Site Address use the same host (www or non-www) and https. Redirect the other version to it.

  2. Exclude session pages from cache

    In your caching plugin or host cache, exclude the cart, checkout, account and multi-step form URLs, and exclude cookies such as woocommerce_cart_hash and wordpress_logged_in_.

  3. Check for plugins that start sessions

    Deactivate plugins one by one on a staging copy to find one that resets or blocks the session cookie.

Session cookie header that survives subdomain stepstext
Set-Cookie: session_id=abc123; Path=/; Domain=example.com; Secure; HttpOnly; SameSite=Lax
Host changes between stepsInteractive
Checkout on a different host

Different host

Leads or data lost

The browser does not send the cookie to the new host. The cart is empty and the visitor leaves.

Toggle the host to see how one redirect can drop the session.

How to confirm it's fixed

Confirmation checks
  • In a private window, the session cookie has the same value on every step of the journey.
  • The cart or form data from step 1 is still there on the last step.
  • No cookie shows a warning icon in the Network tab.
  • Test again on a phone with mobile data, and in Safari and Firefox.
  • Test starting from the non-www and www versions, and from an ad link with UTM parameters.
  • A test purchase or test lead completes and appears in your analytics and CRM.

How to prevent it happening again

Prevention habits
  • Keep one canonical domain and redirect all others to it.
  • Re-test the full journey after every plugin, theme, cache, CDN or domain change.
  • Keep cart, checkout and form step URLs on the cache exclusion list.
  • Document which cookies your funnel needs and who sets them.
  • Test in more than one browser, since cookie rules differ.
  • Run the journey on a schedule so a break is found within a day, not a month.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. It runs your real customer journey with a robot visitor on a schedule, and if the session is lost the journey fails: for example the cart is empty at checkout, or the form on step 2 cannot continue. A failure is re-checked from a second region, then you get one alert with a screenshot and a likely cause.

What it does not do: it does not inspect each cookie's attributes or tell you for certain that the session cookie is the cause. It only sees that the journey failed. It also covers only the journeys you set up, and it uses its own browser, so it will not show problems that appear only in certain visitor browsers, in-app browsers or with their privacy settings.

To cover the rest by hand, use the dev tools steps above after an alert, and test in Safari, Firefox and a phone browser from time to time. FunnelGuard's Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.

Questions people ask

Why is my cart empty when I go to checkout?

The browser is probably not sending the cart's session cookie to the checkout page. This happens when checkout is on a different host (www vs non-www, or another domain), when a cache removes the cookie, or when a SameSite or Secure flag blocks it. Compare the cookie in dev tools before and after the step.

Why does my session cookie change on every page?

The server is creating a new session each time because it does not receive the old cookie. Common reasons are a cache layer stripping Set-Cookie, a cookie set on a different domain or path, or a Secure cookie set over http. Check the Cookie request header on the second page.

How do I keep a cookie between www and non-www?

Best fix: redirect one version to the other so visitors stay on one host. If you need both, set the cookie's Domain attribute to the root domain, such as example.com, so subdomains can read it.

Does SameSite cause a lost session cookie?

Yes, it can. SameSite=Strict or Lax can stop the cookie being sent in cross-site requests, such as a checkout in an iframe or a return from an external payment page. SameSite=None with Secure allows cross-site use but may still be limited by browser privacy settings.

How do I see which cookie is being lost?

Open dev tools, go to Application (or Storage in Firefox) and view Cookies, then move through the funnel and see which one disappears or changes. In the Network tab, compare Set-Cookie in the response and Cookie in the next request.

Can caching cause a session cookie to be lost?

Yes. If a page cache or CDN serves a stored copy of a cart, checkout or form step, it can skip the server and the Set-Cookie header. Exclude those URLs and session cookies from the cache.

Can FunnelGuard detect a lost session cookie?

Only partly. It runs your journey on a schedule and alerts you when it fails, for example when the cart empties at checkout, but it does not read cookie attributes or confirm the cookie as the cause. You still need dev tools to find the exact reason.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: logged_in_element: logged_out when the login session is lost between steps; other cookies via journey failure.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.