An identifier that outlives the login

A session ID issued before authentication can remain valid after authentication completes. The login itself does nothing to invalidate the earlier value, so the identifier that once belonged to an anonymous visitor now sits inside an authenticated session. OWASP calls this session fixation and treats regeneration after any privilege-level change as a mandatory control, with the anonymous-to-authenticated transition as the common case. The attack does not depend on HTTPS being absent; an attacker can plant a session ID on a victim's browser and wait for the application to adopt it.

The same guidance says an application must never accept a session ID it did not generate. When an unknown one arrives, the server issues a fresh valid identifier instead of looking it up. Session IDs submitted through URL parameters should be rejected outright, since a value placed in a link travels through referrers, logs and chat transcripts. Two habits follow from this: regenerate at the privilege boundary, and treat an unrecognised identifier as a reason to start over rather than as a database key.

The attributes around the identifier

An identifier is only as protected as the channel and the cookie around it. OWASP describes Secure as the requirement that the session ID travel only over encrypted HTTPS, and HttpOnly as the barrier that stops scripts reading the cookie through document.cookie. The latter protects confidentiality alone. It does not repair a cross-site scripting flaw, and it does not stop a browser from attaching the cookie to a request. A page able to run script can still cause that request to be sent.

SameSite belongs beside those two. The cheat sheet asks for an explicit SameSite=Strict as the first choice or SameSite=Lax; SameSite=None must be paired with Secure, and browser defaults are no substitute for an explicit setting because they vary across versions. MDN notes that some browsers treat an unset attribute as Lax, which is a claim about some browsers rather than all of them. SameSite also does not replace anti-CSRF tokens; the mechanisms cover different parts of the problem.

Scope matters as much as transport. Domain sends a cookie to a named domain and every subdomain beneath it. With no Domain set, the cookie goes only to the originating server. OWASP advises against setting Domain for a session ID and recommends tightening Path; a broad domain lets a different host under the same parent reach the same identifier, widening the fixation surface. Sharing a session across subdomains is a product decision with an exposure cost, not a protocol-wide prohibition. Prefixes such as __Host- and __Secure- bind attributes at the browser layer as defence in depth, while the server still checks the full cookie name. RFC 6265, published in 2011, defines processing rules for Expires, Max-Age, Domain, Path, Secure and HttpOnly. SameSite, the prefixes and session timeouts are not part of that document.

The two clocks

ClockStarting pointGuidance in the OWASP cheat sheet
Idle timeoutThe session's last requestExamples of 2-5 minutes for high-value applications and 15-30 minutes for low-risk ones
Absolute timeoutCreation of the sessionAn example of 4-8 hours for all-day office use
Enforcement pointThe server, not the clientClient-side token timestamps can be altered to extend a session

Those figures are illustrations selected by application criticality. They are not thresholds imposed by a standard and not a configuration already in use anywhere. A team chooses values by weighing security against usability for the data at stake. Both clocks need to live on the server: when a client carries the expiry in a token or a time parameter, an attacker can rewrite it and extend the session. Enforcement belongs where the identifier is validated, not where the page is rendered.

Ending a session really ends it

MDN notes that a cookie without Max-Age or Expires is deleted when the current session ends, but browser session restoration can keep it far longer. OWASP adds that closing a browser cannot be relied on to force logout, and that deleting a cookie on the client leaves a stolen copy of the identifier untouched. The security-relevant action is server-side invalidation, paired with a visible logout control reachable from anywhere in the product.

Revocation has to cover the whole logical authenticated session. Identifiers produced by rotation and older identifiers still accepted during a grace period must be revoked together. Otherwise a rotated value survives the logout and can resume the session. OWASP is explicit that after logout those identifiers may not authenticate or renew anything. An architectural consequence follows: if the identity store keeps no record of which identifiers are live, there is nothing to revoke.

The stateless shortcut

The JWT cheat sheet records OWASP's engineering position that JWTs are often proposed for stateless user sessions and that this use is not recommended. A session needs a way to end. The common answer is a deny list of revoked tokens, often keyed by the jti and iss claims. Once that list exists the session is no longer fully stateless, and the benefit that motivated the design is spent; the cheat sheet then suggests considering an ordinary session system instead. A signature protects the header and claims against alteration. It does not make logout work by itself.

None of these choices is exotic. Regenerate the identifier at the privilege boundary, set the attributes explicitly, keep both clocks on the server, and revoke every related identifier at logout. Each step narrows the window in which a stolen identifier stays useful. The exact widths are a decision about how much risk the product tolerates, which is why the table describes guidance rather than a fixed policy.

Cross Mini App exposes capabilities through a shared runtime and an open catalog; session state is a sensible thing to centralise at that layer so every capability inherits the same clocks and the same revocation path.

Sources