Join our Newsletter — 33% off our NHI Course
Authentication, Authorisation & Trust

Web Session

← Back to Glossary
By NHI Mgmt Group Updated October 25, 2026 Domain: Authentication, Authorisation & Trust

A web session is the temporary state that lets a browser and a website recognize the same user across multiple requests. In security terms, it is usually maintained by a session identifier or token, which must be protected, scoped, and expired properly to prevent hijacking, fixation, or unauthorized reuse.

What a web session is and why it matters

A web session is the short-lived state that lets a site recognise the same browser across requests. It turns stateless HTTP into an experience with continuity, which is essential for login state, shopping carts, preferences and other user-specific actions.

That continuity usually depends on a session identifier or token. The security challenge is that the token becomes a stand-in for the user’s current access context, so if it is exposed, copied or reused, an attacker may inherit the session without needing the password again.

How session state is created and maintained

Sessions are commonly created after authentication and then tracked with cookies, headers or token-bearing requests. The server may keep the authoritative session record, or it may validate a self-contained token that carries the necessary state.

The design choice affects how the session is validated, refreshed and invalidated. Server-side sessions are easier to revoke centrally, while token-based sessions can scale well but require careful handling of expiry, rotation and replay resistance.

Session scope also matters. A session should be limited to the intended application, path, domain, device context or audience so that it is not reusable in places it was never meant to reach.

Common session security failure modes

Session hijacking happens when an attacker obtains a valid session identifier and impersonates the user. Session fixation happens when an attacker can force or predict a session value before authentication, then reuse it after the victim logs in.

Other failure modes include weak expiration, overly broad cookie scope, insecure transport, predictable identifiers and failure to invalidate sessions after logout, password reset or privilege change. These weaknesses can turn a normal web session into a durable access path.

Because the session often represents an already-authenticated user, compromise can bypass stronger primary authentication controls and expose data, actions and administrative functions that were supposed to remain protected.

Session protection, revocation and verification

Strong session handling means generating high-entropy identifiers, transmitting them only over protected channels, marking cookies appropriately and expiring them when the risk context changes. It also means invalidating old sessions when credentials change or the user signs out.

Verification should cover cookie attributes, token lifetime, audience restrictions, fixation resistance and replay behaviour. For implementation guidance on authentication and session control, OWASP ASVS is a useful reference, and OWASP Cheat Sheet Series provides practical session management guidance.

Where token replay is a concern, sender-constraining can materially reduce abuse. Standards such as RFC 9449: OAuth 2.0 Demonstrating Proof of Possession (DPoP) address that problem by binding token use to proof of possession.

How sessions are monitored and investigated

Session telemetry is useful for spotting unusual reuse, impossible travel, sudden privilege shifts, repeated reauthentication prompts or abnormal session volume. Those signals can indicate theft, automation abuse or a broken logout and revocation path.

When compromise is suspected, investigation should focus on where the session was issued, how long it remained valid, whether it was reused from new contexts and whether related credentials or refresh tokens were also exposed. If the session is tied to sensitive accounts, review adjacent access paths and recent actions as part of post-incident containment.

For broader control coverage and adversary mapping around session abuse, MITRE ATT&CK Enterprise Matrix and NIST SP 800-53 Rev 5 Security and Privacy Controls help anchor detection and access-control decisions.

Risk and Threat Considerations

Web sessions are attractive targets because they often provide direct reuse of an authenticated context. If an attacker steals or fixes a session, they may bypass login protections and act with the victim’s current privileges until the session is revoked or expires.

Failure mechanism: Weak token handling, exposed cookies, replayable bearer tokens and incomplete invalidation let an attacker reuse a session without breaking the original password or MFA flow.

Impact: Unauthorized access can include account takeover, transaction abuse, data theft and lateral movement into higher-value functions if the compromised session belongs to an administrator or trusted application user.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV6 — AuthenticationWeb sessions depend on authenticated user state and session handling.
V7 — Session ManagementThis term is directly about maintaining and protecting browser session state.
Recommendation — Verify session creation, renewal and invalidation requirements alongside authentication controls. Enforce secure cookie attributes, session expiry and revocation controls for every authenticated session.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementSession tokens and related authenticators must be issued, protected and retired safely.
AC-12 — Session TerminationSession lifetime and logout handling are central to preventing reuse after access should end.
IA-2 — Identification and Authentication (Organizational Users)Sessions preserve authenticated user context after initial sign-in.
Recommendation — Manage session-related authenticators with controlled issuance, rotation and invalidation. Terminate sessions promptly when users log out or risk conditions change. Tie session issuance to authenticated users and revalidate identity when required.

Practitioner Guidance

Why practitioners should care: Session design is not a minor implementation detail, it is part of the effective authorization boundary after login. A secure authentication flow can still be undermined by a fragile session lifecycle.

What to watch for: Pay close attention to long-lived sessions, missing revocation, broad cookie scope and any design that allows a stolen token to remain useful after a password reset, device change or privilege change.

Practitioner takeaway: Treat session protection as a lifecycle control, not just a cookie setting, because the security of the whole application often depends on how safely that temporary state is issued, bound and retired.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org