A “Signed out” screen proves that the browser changed pages. It does not prove that the server-side session, refresh token, SSO session, WebSocket, other device, or cached response lost authority. Modern applications distribute one login across several artifacts and services. If the product requirement says only “logout works,” each component may implement a different ending.

A useful test defines what must stop, where, and by when. It then observes every artifact before and after the same logout action. Pentest.red’s article on SaaS tenant security gives the broader account and offboarding context. Here the subject is narrower: a user-triggered logout and the life of already issued session artifacts.

Define the product’s logout promise

Start with explicit variants. Local logout may terminate only the current application session. “Log out of all devices” should reach every active session for that account. RP-initiated SSO logout may ask the identity provider to end its session, while back-channel logout can notify relying parties directly. Account suspension and administrator offboarding are separate events unless the requirements connect them.

Write a measurable rule for each action: affected subject, tenant, device, browser, client application, token family, connection type, expected delay, and offline behavior. Also state whether the identity-provider session should remain active. Without this rule, an immediate SSO re-login can be interpreted as either a vulnerability or the intended local-logout behavior.

Inventory every bearer of authority

Record the session cookie, server-side session identifier, access token, refresh token family, native-app secure storage, remembered-device record, WebSocket connection, service-worker cache, and download link. Do not copy token values into the report. Use a one-way fingerprint, issuance time, audience, client, and test identity.

Scroll sideways to compare

ArtifactValidation after logoutExpected evidence
Session cookierepeat an authenticated requestserver rejects or creates anonymous context
Refresh tokenrequest a new access tokenfamily is rejected according to policy
Other deviceuse an existing sessionresult matches the selected logout variant
WebSocketsend and receive after logoutconnection closes or reauthorization fails
Cached responserevisit protected content offlinesensitive body is not disclosed
SSO sessionrevisit the relying partybehavior matches local or federated promise

This inventory prevents one successful browser redirect from standing in for the whole session lifecycle.

Test server-side invalidation

Capture a harmless authenticated request before logout, perform logout through the supported UI or API, and repeat the same request with the prior cookie. Also test direct navigation, a parallel tab, and a request sent after the UI has cleared local state. A server-side session that still authorizes requests is the central failure even if the browser removed its cookie.

Logout validation
  1. Beforeprove each artifact has only the agreed authority
  2. Actionperform one precisely named logout variant
  3. Afterreplay safe reads and attempt token renewal
  4. Observecorrelate denial, closure and propagation time

Cookie expiry supports browser cleanup, but it is not a substitute for invalidating server state. Conversely, an invalid server session should remain invalid even if a client restores an old cookie from history or a backup.

Follow refresh and access tokens separately

A refresh token can create new access tokens, so test it after logout. Rotation, sender constraints, inactivity expiry, and revocation of the active token family reduce replay opportunity. Record whether a security event revokes only one refresh token, all tokens derived from its grant, or all sessions for the subject.

An already issued self-contained access token may remain accepted until expiry if the architecture does not consult current server state. That can be an explicit bounded design, but it must be visible in the acceptance rule. Measure the residual window against the product promise instead of assuming that a successful revocation endpoint makes every resource server reject instantly.

Include SSO and multiple devices

Run a small state matrix: two browsers on one device, a browser and native client, and two devices. Perform local logout, federated logout, “all devices” logout, password reset, and account suspension only when those actions are in scope. For each cell, state whether the relying party session, identity-provider session, and refresh family should survive.

Back-channel logout matters when relying parties cannot rely on a user agent visiting every logout endpoint. The test correlates the identity-provider event with the relying party session and records delivery delay or failure. It does not assume that every product supports the same OpenID logout profile.

Close live channels and protect caches

A WebSocket authenticated during its handshake can continue carrying data after an HTTP logout unless the application closes it or checks session validity again. Establish a low-impact test subscription, log out through HTTP, and observe both directions. Reconnect with the old cookie or token and verify that authorization is evaluated again.

Then inspect browser history, back navigation, service-worker behavior, application caches, and shared proxies. A cached page may render old sensitive data even though the server correctly rejects new requests. Appropriate cache directives and client cleanup reduce this exposure, while the server remains the authority for new actions.

Use an illustrative two-device scenario

Consider a B2B portal with a laptop browser and mobile client. The user chooses “log out of this device” on the laptop. The old cookie is rejected immediately and its WebSocket closes; the mobile session remains active by design. The laptop’s old refresh token is rejected, but one access token continues to work for two minutes until expiry.

That two-minute result is not automatically a finding. It becomes a finding if the agreed promise was immediate revocation at every resource server, or an accepted limitation if the documented architecture and risk decision allow that bound. The example is illustrative and does not describe a real customer test.

Accept a timed evidence chain

The evidence package identifies the logout variant, test identity, artifact fingerprints, clients, request sequence, server responses, token events, socket closure, cache result, timestamps, and stated threshold. Correlation logs should show invalidation without recording raw credentials. Repeating the test after session-service, gateway, or identity-provider changes keeps the result meaningful.

Pentest.red can include this matrix in a web application pentest with exact safety limits recorded in the pentest scope. The sample pentest report shows how observations, evidence, and limitations can be separated. The conclusion applies to the tested clients, logout variants, and observation window; it does not prove every identity workflow ends every session.

PENTEST.RED

Discuss pentest scope and pricing

We start by agreeing on systems, access, constraints and the expected evidence.

Prepare your testing scope

Based on in-depth research, edited for clarity and practical use.

PENTEST.RED / RED JOURNAL