Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Session expires mid-onboarding: how to find and fix it

CNV-299Low impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

A session is how a website remembers who you are between page loads. It is usually a cookie holding a session ID or a signed token. Each session has a lifetime. When the lifetime ends, the site treats the visitor as logged out.

Session expires mid-onboarding means that lifetime ends while a new user is still setting up their account. Typical causes are an idle timeout set to a few minutes, a short-lived auth token with no refresh, a CSRF (cross-site request forgery) token that expires before the form is submitted, or a verification step in another tab or app that creates a second session and invalidates the first.

Why it costs you leads or sales

Onboarding is where a signup turns into an active user. If someone has filled in company details, invited teammates or connected an integration and then gets logged out, they have to redo the work or they give up. New users have the least patience and no loyalty yet.

The impact is usually smaller than a broken signup form, because only people who pause or take a long step are hit. But those people are often the most engaged: they are doing real setup work, switching tabs to find an API key or waiting for a colleague to approve access.

Where a timeout breaks the journey
  1. SignupAccount created, session starts
  2. Profile setupUser pauses to find details
  3. Session expiresNext click returns login or error
  4. Connect integrationNever reached
  5. ActivationKey action never happens

The user is logged out between steps 2 and 3, so later steps are lost.

Users reaching activation by session timeoutExample numbers
Users reaching activation by session timeout (example)30 min timeout: 38 % of signups; 8 hour timeout: 46 % of signups; Timeout plus saved progress: 49 % of signups0193838464930 min timeout8 hour timeoutTimeout plus saved pr…% of signups

Example: illustrative numbers showing how a short timeout can cut activation among users who pause during setup.

How to check if your site has it

You need to simulate a user who pauses. Do not just click through quickly, because a fast test never reaches the timeout.

Test for a mid-onboarding timeout
  1. Find the configured lifetime

    Check your auth settings or ask your developer. Look for idle timeout, absolute timeout, access token lifetime and CSRF token lifetime.

  2. Create a fresh test account

    Use a private window and a new email address so no old session interferes.

  3. Stop halfway and wait

    Pause on a middle onboarding step for longer than the shortest timeout you found, or for 30 to 60 minutes if you do not know it.

  4. Continue and watch what happens

    Click Next or Save. Note whether you are logged out, shown an error, sent back to step one, or lose entered data.

  5. Inspect the cookie

    In browser DevTools open Application > Cookies and check the Expires / Max-Age of the session cookie. Also open the Network tab and look for 401 or 403 responses when you continue.

  6. Try the email verification detour

    Leave the tab, open the verification email on a phone or another browser, then return. Check that the original tab still works or recovers cleanly.

How to fix it

The right fix depends on how your app handles sessions. Start with the lifetime, then make the flow tolerant of a timeout anyway.

Fix a session that expires during onboarding
  1. Lengthen the session for new users

    Set the idle timeout long enough for realistic setup, for example hours rather than minutes. Balance this against security needs for sensitive apps.

  2. Refresh the session while the user is active

    Use sliding expiration so each request extends the session, or silently renew the token before it expires.

  3. Save progress on the server at each step

    Store answers as soon as each step is submitted, not only at the end, so a new login can resume where the user stopped.

  4. Resume after login

    If a user does get logged out, send them back to the onboarding step they were on after login, using a return URL, not to the dashboard or step one.

  5. Fix CSRF and form tokens

    Make form tokens last as long as the session, or reload a fresh token on submit failure and keep the typed values.

  6. Show a clear message

    If expiry is unavoidable, say so in plain words and keep entered data in the form.

Where to change the session lifetime
  1. Extend the login cookie

    WordPress keeps users logged in for 2 days by default, or 14 days with Remember Me. Use the auth_cookie_expiration filter to change it.

  2. Check plugins

    Security or membership plugins often add their own idle logout. Look in their settings for session or inactivity timeout.

WordPress: keep users logged in for 12 hours (example)php
add_filter( 'auth_cookie_expiration', function( $expiration, $user_id, $remember ) {
    return 12 * HOUR_IN_SECONDS;
}, 10, 3 );
Express: rolling session cookie (example)javascript
app.use(session({
  secret: process.env.SESSION_SECRET,
  resave: false,
  saveUninitialized: false,
  rolling: true,
  cookie: { maxAge: 1000 * 60 * 60 * 8, httpOnly: true, secure: true, sameSite: 'lax' }
}));
Onboarding with and without timeout handling

Before

  • Session ends after a short idle period
  • User sees login page or generic error
  • Entered answers are lost
  • After login the user lands on the dashboard or step one

After

  • Session renews while the user is active
  • Progress saved on the server at each step
  • If logged out, a clear message appears
  • After login the user returns to the same step

How to confirm it's fixed

Confirmation checks
  • Pause on a middle step for longer than the old timeout and continue without being logged out
  • Check the session cookie expiry in DevTools matches your new setting
  • Force a logout and confirm login returns you to the same onboarding step
  • Confirm previously entered answers are still there
  • Verify email in another browser and confirm the original tab still works
  • Check the Network tab shows no 401 or 403 on step submits

How to prevent it happening again

Prevention habits
  • Document the session, token and CSRF lifetimes in one place
  • Re-test onboarding with a long pause after any auth, security or framework update
  • Add an automated test that expires the session mid-flow and checks recovery
  • Review security plugin changes, which often shorten timeouts quietly
  • Track users who hit the login page during onboarding as an analytics event
  • Keep a note of the longest realistic step, such as waiting for an email or approval, and set timeouts above it

How FunnelGuard handles this

FunnelGuard does not check for this yet. A timed-step check that pauses mid-journey and confirms the session survives is a possible future addition, but it does not exist today.

What FunnelGuard does cover nearby: it runs your real customer journeys on a schedule, such as lead forms, checkouts and booking buttons, checks each step, and re-checks a failure from a second region before sending one alert with a screenshot and a likely cause. That can reveal a signup or onboarding step that breaks outright. It will not reveal a session that only expires after a long pause.

To watch for this yourself, repeat the manual pause test after each release, log 401 responses and unexpected logins in your app monitoring, and add a custom analytics event when a user lands on the login page during onboarding. You can start with the free FunnelGuard plan (1 site, 2 journeys, daily checks, no card) to cover the rest of your funnel.

How the problem unfolds for one user
  1. 0 min

    User signs up and starts onboarding

  2. 10 min

    User leaves to find an API key

  3. 31 min

    Session idle timeout passes (example 30 min limit)

  4. 35 min

    User returns, clicks Save and is sent to login with progress lost

Questions people ask

Why does my session expire during onboarding?

Usually the session or token lifetime is shorter than the time a new user needs to finish setup. Other causes are expired CSRF tokens, a security plugin adding an idle logout, or a second login in another browser invalidating the first.

How long should a session last during onboarding?

Long enough for the slowest realistic step, which is often several hours rather than minutes. The right value depends on how sensitive your app is, so use sliding expiration to renew the session while the user is active.

How do I stop users losing progress when they get logged out?

Save answers on the server as each step is submitted, and send the user back to the same step after login using a return URL. That way a timeout becomes a small interruption instead of a restart.

Why does the verification email log me out of onboarding?

Opening the link in another browser or app can create a new session and invalidate the old one, or the original tab's token may expire while you wait. Make the original tab recover by refreshing its session or by resuming after login.

How do I test for a session timeout in my signup flow?

Create a fresh test account in a private window, stop on a middle step for longer than your timeout, then click Next. Check whether you are logged out, shown an error or lose data, and look for 401 responses in DevTools.

Does FunnelGuard detect session timeouts in onboarding?

No. FunnelGuard does not check this yet, though a timed-step check is a possible future addition. It does run your real journeys on a schedule and alerts you when a step breaks outright, so test long pauses manually.

Is a short session timeout a security feature or a bug?

Both can be true. Short timeouts reduce risk on shared devices, but for new users mid-setup they cause avoidable drop-off. Compromise with sliding expiration, saved progress and a clear resume path.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: logged_in_element (logged out mid-journey) + session_valid on web_app journeys.

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.