Course outline

Web Security / Basic: web trust and identity contracts / Lesson 7

Distinguish logout from cached page display

Test server-side session revocation separately from browser cache behavior in a synthetic lab.

About 4 min readContent reviewed
On this page

Lesson goals

  • Distinguish a cached page from a fresh authorized request.
  • Test an agreed logout policy with synthetic sessions.
  • Record denial and side-effect evidence safely.

Separate displayed content from authority

A browser can display a page from a previous response even after the user’s server-side session has changed. That visible page is not by itself proof that a new protected request would succeed. Conversely, clearing a browser’s displayed content does not prove that the server revoked a copied session. In a synthetic lab, define what logout should do for the current session and whether other sessions remain active. Use this explicit policy as the basis for the expected result.

Follow a protected request

A protected request needs a server-side decision about the current session and the requested action. Create a synthetic account and verify that an active session may perform an agreed action, then log out and send a fresh request under the same session context. Record the action, response and relevant protected state without recording the session token. The table shows the expected behavior for this lab policy, not a universal rule for every application or credential type.

text Synthetic session observations
Step | Session | Expected
open protected page | active | permitted
repeat after logout | revoked | denied

The table describes the lab policy and diagnostic questions; it does not claim execution.

Understand cached presentation

Browser and intermediary caches can preserve responses, so test the page presentation separately from the server’s authorization decision. If a page reappears after logout, inspect whether it came from a cache and whether a new request is denied. Review the application’s cache controls for sensitive content. A correct cache policy helps prevent inappropriate reuse, while the server must still enforce authorization for fresh requests. Avoid storing real personal data in the exercise.

Test logout with a synthetic session

Use an authorized isolated application with two synthetic sessions if the policy distinguishes current-session logout from all-session logout. Record the initial state, logout action and the result of a fresh request for each session. Verify the rejected request did not modify protected state, and inspect relevant session storage or revocation evidence through an approved safe observation path. The second table separates a displayed symptom from the next diagnostic question; it is not an execution result.

text Synthetic session observations
Observation | Next check
page reappears | fresh server request
fresh request denied | inspect browser cache

The table describes the lab policy and diagnostic questions; it does not claim execution.

Record evidence and limits

After a correction, repeat both the permitted active-session case and the post-logout case with fresh synthetic data. Include a second application instance when the session design is distributed, and record the observation window and propagation assumptions. Protect tokens and identifiers in shared evidence. These checks support the specific policy and paths tested; they cannot establish that every session, cache, device or recovery workflow behaves correctly. Keep other untested boundaries visible to the decision owner.

Common errors and fixes

Treating a reappearing page as proof of a valid session

Why it happens
The browser may display cached content.
How to fix it
Inspect a fresh protected request and its response.
Prevent it next time
Test cache behavior and server authorization separately.

Assuming a cleared cookie revokes server state

Why it happens
Browser state and server session state are distinct.
How to fix it
Verify the relevant server-side invalidation under policy.
Prevent it next time
Maintain an isolated revocation regression case.

Logging a session token for diagnosis

Why it happens
Sensitive credentials are copied into shared evidence.
How to fix it
Remove the token and follow the response procedure.
Prevent it next time
Use a safe reference and redact headers.

2 practice exercises

1. A page reappears after logout, but a fresh protected request is denied. What should be investigated?

Show worked solution

Investigate browser or intermediary caching and the applicable cache controls. The denied fresh request is evidence of the server decision for that path.

2. The browser cookie disappears after logout. Does this prove server-side revocation?

Show worked solution

No. Check the relevant server session invalidation in the isolated test, while protecting token values and respecting the documented logout scope.

Key takeaways

  • A displayed page and a fresh server authorization decision are different observations.
  • Verify logout and cache behavior against an explicit policy.

Official references