View all services
Talk to QA Advisor
Browse the Knowledge Hub56 resources
/Test Cases/Session timeout and concurrent login test cases

Test cases

Session test cases, for the token that still works

Twenty eight cases covering tokens that survive sign out, refresh token reuse detection, idle against absolute lifetime, background polling that never lets a session end, unsaved work at expiry, multi tab consistency, identifier rotation, concurrent session limits and remote revocation.

28cases/8coverage types/16security cases/FreeCSV download

All 28 test cases, ready to copy

Free to use and adapt, no sign-up. Download as CSV or Markdown, or copy it straight into your own tooling.

Last updated

28 worked examples

SES-01

Expire a session after the idle timeout

TypeSecurityPriorityHigh
Test data
Sign in, remain idle past the configured idle period, then act
Expected result
Request is refused and re-authentication is required. Idle time is measured from the last genuine request rather than from any background polling.
SES-02

Enforce the absolute session lifetime

TypeBoundaryPriorityHigh
Test data
Stay continuously active past the absolute maximum session duration
Expected result
Session ends regardless of activity. Without an absolute cap, a session refreshed by activity can live indefinitely.
SES-03

Refuse a session token after the server side session has ended

TypeSecurityPriorityHigh
Test data
Capture the session token, wait for expiry, then send it directly to a protected endpoint
Expected result
Refused with 401. This is the case that matters most: a session cleared only in the browser is not expired, and the token still works.
SES-04

Refuse a token after explicit sign out

TypeSecurityPriorityHigh
Test data
Sign out, then replay a request using the captured token
Expected result
Refused. Sign out invalidates the session on the server rather than deleting a cookie and trusting the client not to keep a copy.
SES-05

Refuse a refresh token after sign out

TypeSecurityPriorityHigh
Test data
Sign out, then exchange the captured refresh token for a new access token
Expected result
Refused. A refresh token that survives sign out silently restores the whole session and defeats the control entirely.
SES-06

Detect a reused refresh token

TypeSecurityPriorityHigh
Test data
Exchange a refresh token successfully, then exchange the same token again
Expected result
Second attempt is refused and the token family is invalidated, because reuse is the observable signature of a stolen token.
SES-07

Warn before an idle session expires

TypeFunctionalPriorityHigh
Test data
Idle until the warning threshold, then extend, then idle to expiry without responding
Expected result
Warning appears with the remaining time, extending genuinely renews the server side session, and ignoring it ends the session at the stated moment.
SES-08

Prevent background activity from extending a session forever

TypeSecurityPriorityHigh
Test data
Leave a page open that polls or auto saves while the user is genuinely absent
Expected result
Idle timeout still fires. Counting automated requests as activity means an open tab keeps a session alive indefinitely.
SES-09

Preserve unsaved work when a session expires

TypeStatePriorityHigh
Test data
Fill a long form, let the session expire, then submit
Expected result
Entered values are retained through re-authentication or recoverable afterwards. Silently discarding a completed form is the reason users hate this control.
SES-10

Return to the interrupted page after re-authentication

TypeStatePriorityMedium
Test data
Expire while on a deep page with filters applied, then sign in again
Expected result
User returns to the same page and state, and the stored return path is validated as internal so it cannot be used as an open redirect.
SES-11

Do not resubmit the interrupted request automatically

TypeSecurityPriorityHigh
Test data
A payment or delete request that fails on expiry, followed by re-authentication
Expected result
Destructive action is not replayed silently. The user is returned to a state where they can choose to repeat it deliberately.
SES-12

Expire the session consistently across open tabs

TypeStatePriorityHigh
Test data
Three tabs open, session expires while one is in focus
Expected result
Every tab reflects the expired state rather than one tab continuing to appear signed in and failing on the next action.
SES-13

Propagate sign out to every open tab

TypeStatePriorityMedium
Test data
Sign out in one tab with two others open
Expected result
Other tabs move to a signed out state promptly rather than showing stale authenticated content until they are refreshed.
SES-14

Rotate the session identifier after authentication

TypeSecurityPriorityHigh
Test data
Capture the pre-authentication identifier and compare it after sign in
Expected result
A new identifier is issued, so an attacker who planted the earlier value does not hold a valid authenticated session.
SES-15

Rotate the session after a privilege change

TypeSecurityPriorityHigh
Test data
Change password, then change role, while the session is active
Expected result
A new session is issued and the old one is invalidated, so a session captured before the change does not retain the earlier state.
SES-16

Invalidate other sessions after a password change

TypeSecurityPriorityHigh
Test data
Sign in on three devices, change the password on one
Expected result
Other sessions end according to the documented policy. A password change that leaves existing sessions alive does not evict an intruder.
SES-17

Allow concurrent sessions up to the documented limit

TypeBoundaryPriorityHigh
Test data
A limit of two sessions. Sign in on a third device, then on two devices simultaneously
Expected result
Third is refused or the oldest is ended according to policy, and the simultaneous case resolves to exactly the limit rather than allowing an extra through a race.
SES-18

List active sessions accurately

TypeFunctionalPriorityMedium
Test data
Sign in from three devices, sign out of one, force kill the app on another
Expected result
List shows the genuinely active sessions with device and last used time, and a session ended abnormally is removed within the stated window.
SES-19

Revoke a specific session remotely

TypeSecurityPriorityHigh
Test data
Revoke one session from another device, then use the revoked session
Expected result
Revoked session is refused immediately, including its refresh token, because this is the control a user relies on after losing a device.
SES-20

Revoke every session at once

TypeSecurityPriorityHigh
Test data
Use sign out everywhere with four active sessions
Expected result
All sessions and refresh tokens are invalidated, and the session performing the action either ends too or is clearly stated to survive.
SES-21

Set session cookie attributes correctly

TypeSecurityPriorityHigh
Test data
Inspect the session cookie and any persistent token
Expected result
Secure and http only with an appropriate same site value and a scoped path, and no session value appears in a URL, in local storage or in a server log.
SES-22

Honour remember me without weakening sensitive actions

TypeSecurityPriorityHigh
Test data
Sign in with remember me, return after the idle period, then attempt a sensitive action
Expected result
Persistent session restores general access but a sensitive action requires re-authentication, and the persistent token is revocable.
SES-23

Bind the session to its context where policy requires it

TypeSecurityPriorityMedium
Test data
Replay a session token from a different address and a different user agent
Expected result
Documented policy is applied consistently, and any binding tolerates a legitimate network change rather than signing out every mobile user who moves.
SES-24

Refuse a session belonging to a deactivated account

TypeSecurityPriorityHigh
Test data
Deactivate the account, then use an active session and a refresh token
Expected result
Both refused within the documented window. A session that outlives deactivation keeps a removed user inside the application.
SES-25

Handle a clock difference between client and server

TypeBoundaryPriorityMedium
Test data
Set the device clock forward and backward by an hour
Expected result
Expiry is decided by the server, so a changed device clock neither extends the session nor ends it early.
SES-26

Expire a session during a file upload or long request

TypeStatePriorityMedium
Test data
Start a large upload, let the session expire mid transfer
Expected result
Clear failure with a route to retry after re-authentication, no partial file is committed, and the browser does not hang with no feedback.
SES-27

Handle expiry inside a mobile or embedded browser

TypeCompatibilityPriorityMedium
Test data
Background the app for longer than the idle period, then return, with third party cookies blocked
Expected result
Expired state is detected on return and re-authentication is offered, rather than a blank screen or an endless loading state.
SES-28

Announce expiry and warnings to assistive technology

TypeAccessibilityPriorityMedium
Test data
Screen reader active when the warning appears and when the session ends
Expected result
Warning and expiry are announced rather than only shown, the extend control is reachable by keyboard, and focus moves predictably to the dialogue.

What goes in each field

ID

Required

Stable identifier, prefixed by module.

Test case

Required

What is being verified, in one line.

Type

Functional, negative, boundary, security, state, performance, accessibility or compatibility. Use it to check coverage is spread rather than clustered on the happy path.

Priority

Risk based. Anything that leaves a session valid after it should have ended, or that loses work the user had entered, is High. A session that expires only in the interface is the highest priority case in the set.

Test data

The specific values, including the invalid and boundary ones.

Expected result

Required

The precise observable outcome, including message text where the wording itself is the requirement.

How To Use This

Sign out, then replay the token

Every one of these is checked from outside the browser, because the browser is the one place session expiry always looks correct.

Keep the token, then sign out

Capture the session token, sign out, and send it straight to a protected endpoint. If it still works, the session was only ever cleared in the browser and nothing was invalidated.

Try the refresh token too

A refresh token that survives sign out silently rebuilds the whole session. Exchanging it twice should also fail, because reuse is the signature of a stolen token.

Leave a polling page open

Walk away from a tab that auto saves or polls. If background requests count as activity, the idle timeout never fires and the session lives as long as the tab does.

Expire mid form

Fill a long form, let the session expire, then submit. Discarding the work is the reason users disable this control wherever they are given the option.

What Most Sets Miss

Why session defects survive testing

Almost every session test is run through the interface, and the interface is exactly where expiry always appears to work. The cookie is cleared, the router redirects to sign in, and the screen is convincing. None of that says anything about whether the server invalidated the session. The only test that answers the question is to capture the token before signing out and then send it directly to a protected endpoint. If it succeeds, sign out is a client side illusion, and anyone holding a copy of that token keeps access for as long as it remains valid. The refresh token deserves the same treatment, because one that outlives sign out reconstructs the entire session on demand.

Timeouts need two limits rather than one. An idle timeout refreshed by activity has no upper bound, so a session can live for weeks as long as someone keeps using it, which is precisely what an attacker with a stolen token will do. An absolute lifetime caps it. The complementary defect is counting automated traffic as activity: a page that polls for notifications or auto saves a draft will hold a session open indefinitely while the user is genuinely absent, and this is the single most common reason an idle timeout does not work in practice.

The user experience half is not a nicety, it is why the control gets weakened. A session that expires and discards a completed form teaches people to avoid the product or to demand a longer timeout, which undoes the security benefit. Preserving entered values through re-authentication, returning to the interrupted page, and specifically not replaying the interrupted request when it was destructive are all testable and all usually absent. Multi tab behaviour belongs here too, since one tab continuing to look signed in after another expired produces failures the user cannot explain.

Finally, revocation is the part users actually rely on. After losing a device or suspecting a compromise, the controls that matter are ending one named session, ending all of them, and having a password change invalidate the others. Each needs to take effect immediately and each needs to cover refresh tokens, otherwise the session reappears at the next refresh. A concurrent session limit needs a concurrency case of its own, because two simultaneous sign ins against a limit of two will let a third through if the count is read and then written.

Suggest an improvement

Testing authentication and session handling?

QAble tests session lifecycle from outside the browser, including server side invalidation, token rotation, revocation and concurrent session limits under load.

Cyber security testing services

More test case sets

View all

Test cases for a login page

Test cases
25 cases across functional, negative, boundary, security, session and accessibility paths, including account enumeration and lockout.

Test cases for a registration form

Test cases
28 cases covering validation, duplicate accounts, email verification, password rules and the enumeration leak most signup forms ship with.

Test cases for search functionality

Test cases
28 cases across relevance, partial and fuzzy matching, filters, pagination, empty states, injection attempts and performance under load.

Test cases for a shopping cart

Test cases
27 cases on quantity limits, price recalculation, stock changes, coupon stacking, guest to account merge and cart persistence.

Test cases for checkout and payment

Test cases
30 cases including 3D Secure, declines, timeouts, duplicate charges, idempotency, refunds and partial captures.

Test cases for file upload

Test cases
28 cases on size and type limits, spoofed content types, malicious filenames, progress, resume, virus scanning and storage limits.

Test cases for forgot password

Test cases
26 cases on reset token expiry, single use enforcement, session invalidation and the enumeration and rate limit gaps that are routine here.

Test cases for OTP verification

Test cases
26 cases on expiry, resend throttling, attempt limits, code reuse, delivery failure and the brute force window teams forget to close.

Test cases for user roles and permissions

Test cases
26 cases on horizontal and vertical privilege checks, direct object access, role changes mid-session and permission inheritance.

Test cases for form validation

Test cases
27 rules-based cases on required fields, length and numeric boundaries, client and server parity, hidden field tampering and error accessibility.

Test cases for a date picker

Test cases
26 cases on timezone shifts, ambiguous day and month order, impossible dates, min and max limits, leap years and keyboard operation.

Test cases for pagination

Test cases
24 cases on ordering stability, records changing mid-session, page size caps, deep offset cost, permission-filtered totals and state restore.

Test cases for push notifications

Test cases
26 cases on app states, deep link routing, token release on sign out, lock screen privacy, preferences, provider failures and platform differences.

Test cases for reports and data export

Test cases
25 cases on permission filtering in the file, spreadsheet formula injection, encoding, typed numbers and dates, row limits and audit logging.

Test cases for a chatbot

Test cases
28 cases on paraphrased intents, context, fallback loops, human handoff, policy grounding, prompt injection and data scoping.

Test cases for net banking transactions

Test cases
28 cases on duplicate debits from a retried request, concurrent transfers against one balance, daily limits across channels, beneficiary cooling periods, second factor binding and reconciliation.

Test cases for wallet and UPI payments

Test cases
28 cases on payments that time out with no response, idempotency on retry, racing balances, caps across devices, collect request fraud, mandates and refunds.

Test cases for insurance claim submission

Test cases
28 cases on coverage at the date of loss, waiting periods, deductibles and sub limits, exclusions and riders, duplicate claims and settlement reconciliation.

Test cases for patient records in an EHR

Test cases
28 cases on duplicate detection and merge, wrong patient entry, units of measure, allergy and interaction alerting, break glass access and audit of reads.

Test cases for CRM lead management

Test cases
28 cases on duplicate leads under concurrency, routing and the unrouted fallback, round robin races, territory visibility, conversion and bulk import.

Test cases for an ERP purchase order

Test cases
28 cases on approval thresholds, amendments that must reset approval, budget commitment races, over receipt tolerance, three-way match and duplicate invoices.

Test cases for OTT video playback

Test cases
28 cases on bitrate recovery after a dip, DRM renewal mid stream, concurrent stream limits and leaked slots, resume conflicts, ad cue points and offline expiry.

Test cases for game level progression

Test cases
28 cases on save corruption during a crash write, cloud save conflicts, offline queue replay, unlock gating, currency exploits and purchase restore.

Test cases for a REST API

Test cases
28 cases on status code correctness, cross tenant resource access, mass assignment, idempotent retries, cursor pagination, rate limits and contract drift.

Test cases for SSO and social login

Test cases
28 cases on linking an account on an unverified email, state and code replay, redirect allow lists, token signature and issuer, deprovisioning and session rotation.

Test cases for subscription and billing

Test cases
28 cases on mid cycle proration, duplicate and out of order webhooks, renewal double charges, dunning and grace, trials, coupons, metered usage and tax.

Test cases for data tables, filters and sorting

Test cases
28 cases on unstable sorts across pages, filters that must reset pagination, selection surviving a filter change, bulk action scope and export fidelity.

Test cases for a multi step form wizard

Test cases
28 cases on values lost to back navigation, refresh and session expiry, step skipping, server side revalidation, duplicate submission and conditional branches.

Test cases for email verification

Test cases
28 cases on token reuse and expiry, invalidating earlier links, account enumeration, header injection, safe address change and mail scanner prefetching.

Test cases for dashboards and analytics widgets

Test cases
28 cases on reconciling against source rows, widgets that disagree, timezone aggregation, zero baselines, no data shown as zero and permission leaks in aggregates.

Test cases for booking and reservation

Test cases
28 cases on concurrent bookings for the last slot, inventory holds that leak, payment without a booking, cancellation boundaries and channel sync.

Test cases for mobile app install and update

Test cases
28 cases on migration chains across skipped versions, crashes during post upgrade migration, forced update lockouts, deep links and clean reinstall.

Test cases for accessibility (WCAG 2.2 AA)

Test cases
28 cases on keyboard only completion, focus management, live region announcements, contrast, reflow at 320 pixels, target size and screen reader verification.

Test cases for performance and load

Test cases
28 cases on spikes with no ramp, recovery after peak, soak and leak detection, pool exhaustion, cold caches, retry storms and data correctness under load.

Test cases for the OWASP Top 10

Test cases
28 cases on broken access control, mass assignment, injection across every input surface, credential stuffing, session invalidation, SSRF and exposed secrets.

Test cases for cross browser compatibility

Test cases
28 cases on storage that throws in private mode, blocked third party cookies, engine date parsing, mobile viewport units, in app browsers and ad blockers.

Test cases for database and data integrity

Test cases
28 cases on uniqueness under concurrency, lost updates, counter races, orphaned rows, migration and backfill safety, replica lag and verified restores.

Test cases for localisation and multi language support

Test cases
28 cases on text expansion, concatenated sentences, plural rules, locale date parsing, decimal separators, right to left layout, collation and encoding.

Want your session controls proven, not assumed?

QAble covers functional, boundary and security paths with ISTQB-certified engineers. Start with a free QA audit of your application.

Talk to QA Advisor