Skip to main content
Join us at Abnormal Innovate on November 5 in Dallas, TX

Sep 26, 2026

What Is Session Cookie Hijacking? How Attackers Steal Sessions

Session cookie hijacking can bypass MFA and passkeys entirely. Learn how attackers steal and replay session tokens and the layered defenses that stop them.

Session cookie hijacking is the theft and reuse of the identifier a web application gives your browser after a successful sign-in. It can provide account access without obvious login warnings, even when passwords and sign-in controls remain intact. Understanding where that identifier can be intercepted, and where it can be stopped, determines whether a stolen cookie becomes a minor incident or a full account takeover.

Key Takeaways

  • A session cookie is a bearer token, which means whoever presents it is treated as the authenticated user with no further identity check.

  • Stealing a cookie and replaying it are separate stages of an attack, and each stage can be blocked or detected with different controls.

  • Strong login security, including multi-factor authentication (MFA) and passkeys, protects the moment of sign-in but not a token stolen afterward.

  • Layered defenses shorten cookie lifetimes and watch for out-of-context reuse. Rapid revocation further reduces how much a stolen cookie is worth to an attacker.

Session cookie hijacking is an attack in which someone steals or manipulates a session identifier and then reuses it to take over the logged-in session it represents.

The attack exists because Hypertext Transfer Protocol (HTTP) is stateless: the protocol has no memory of who you are from one request to the next, so web applications create a session at login and hand the browser a cookie containing an identifier that ties every later request back to that session. The identifier is usually opaque: it is a long random string used only as a lookup key on the server. The password proves identity once at login; the cookie stands in for that proof on every request afterward.

That distinction separates several related attacks worth keeping straight:

  • Credential Theft: Targets the secret used to establish a session.

  • Session Hijacking: Targets the token representing a session already established.

  • Session Fixation: A variant in which the attacker plants a known identifier in the victim's browser before login, then waits for authentication to make it valuable.

  • Sidejacking: One specific method: passively sniffing the cookie from unencrypted network traffic.

  • Replay Attack: The final move common to most of these attacks. The attacker retransmits a captured token to gain access they were never granted.

Together, these five terms map the full spectrum of ways a session identifier can be abused, from the moment it's created to the moment it's replayed.

In a session cookie hijack, the server first issues an identifier. The attacker obtains or controls its value and later presents it back to the server as proof of identity.

Creating and Binding the Authenticated Session

When you sign in, the server generates a session identifier, stores the associated state on its side, and sends the identifier to your browser in a Set-Cookie response header. From then on, the browser attaches the cookie to every matching request, and the server uses it to look up who you are. The cookie's attributes determine its scope and lifetime, and they also control who can read it:

Attribute

What It Controls

 

Secure

Restricts the cookie to encrypted HTTPS connections

HttpOnly

Makes the cookie invisible to JavaScript running in the page

SameSite=Strict

Sends the cookie on same-site requests only

SameSite=Lax

Also permits certain cross-site top-level navigations

SameSite=None

Sends the cookie in cross-site contexts, but requires Secure

Domain

Widens the cookie to hosts under a parent domain if set; leaving it unset keeps the cookie on the issuing host

Path

Limits which URL paths trigger transmission (not a security boundary)

Max-Age

Caps the cookie's lifetime; without one, a cookie generally lasts until the browsing session ends, though session restoration can extend that after a restart

__Secure- prefix

Requires the cookie to be set with Secure over HTTPS

__Host- prefix

Also requires Path=/ and prohibits the Domain attribute, keeping the cookie on the exact issuing host

Two of these, the __Secure- and __Host- prefixes, add browser-enforced naming conventions on top of the attributes above: they keep the cookie on the exact host that set it and prevent a subdomain from injecting a fixation cookie into the parent site.

An adversary-in-the-middle reverse proxy relays a victim's login credentials and MFA response to the real server, then intercepts and copies the returned session cookie before forwarding it, enabling replay without triggering login alerts.

Stealing or Manipulating the Session Identifier

Each theft vector enters the lifecycle at a different point:

  • Cross-Site Scripting (XSS): Enters through the page itself: injected JavaScript can read and transmit a cookie whenever it lacks HttpOnly.

  • Malicious Browser Extensions: An extension with appropriate browser cookie permissions and host access may enumerate and exfiltrate cookies for permitted domains.

  • Infostealer Malware: Skips page-level controls and targets browser data stored on the endpoint. Depending on the browser, operating system, and available protections, it may read and decrypt the cookie database using functions available to the compromised user. This malware commonly arrives through phishing and malvertising, with trojanized software as another delivery method.

  • Sidejacking: Intercepts a cookie in transit by sniffing unencrypted traffic on open Wi-Fi or a compromised network segment.

  • Adversary-in-the-Middle (AiTM) Phishing: Intercepts the login flow. A reverse proxy relays the victim's real login, waits for multi-factor authentication (MFA) to complete, and captures the session cookie issued afterward. A CISA advisory documents how Star Blizzard, an actor assessed as subordinate to Russia's Federal Security Service, bypassed MFA on victim email accounts with this technique.

  • Session Fixation: Begins before authentication. The attacker obtains a valid pre-login identifier and tricks the victim into using it.

  • Predictable Identifiers: Require no theft at all. If the generator is weak, an attacker may model it and guess other users' sessions.

Whichever vector succeeds, the outcome is the same: the attacker now holds a value the server will treat as proof of an already-authenticated user.

Once the attacker holds a valid session cookie, they can import it into another browser or attach it to scripted requests, and the server resumes the session as though the legitimate user never left. No login page appears and no second factor fires because the session already passed those checks when the real user authenticated. As a bearer token, the session cookie remains valid for whoever presents it until it expires or is revoked.

The attacker does not steal an authenticated session cookie in a fixation attack because they planted the identifier before the victim logged in. If the application fails to issue a fresh identifier after authentication, the attacker's known identifier becomes an authenticated session they can enter at will. Either path can let the attacker access mailboxes, download data, change configurations, or establish persistence that outlasts the cookie itself. This is why session cookie theft and reuse need separate controls: preventing one stage does not guarantee protection against the other.

Risks and Real-World Consequences of a Hijacked Session

A hijacked session hands the attacker everything the legitimate user can see and do for as long as the session stays valid.

The attacker may read and export data, initiate fraudulent transactions, move laterally into connected systems through accessible tokens and integrations, or trigger regulatory obligations when protected data leaves. Because the attacker operates with the account's existing authority, the damage depends heavily on the user's privileges and connected resources. The impact can continue after revocation because attackers may use the session to create forwarding rules, authorize applications, add devices, or change recovery settings. A compromised account can also send convincing messages or expose confidential material. This can create reputational harm alongside investigation, notification, recovery, and compliance costs.

Infostealer malware could steal the authenticated session of a software engineer whose account is protected by multi-factor authentication (MFA). Because it takes the post-login token rather than the password, the second factor does not prevent a replayed session from inheriting the account's access. Tokens exposed through troubleshooting archive files pose the same risk if they remain valid when another party obtains the file.

The most effective defense maps each control to the lifecycle stage it protects. Controls should reduce theft and spot replay. Rapid response should end unauthorized access.

Several layers of control interrupt these theft paths before they succeed:

  • HTTPS and HSTS: Serving every page over HTTPS and enforcing it with HTTP Strict Transport Security (HSTS) removes the plaintext traffic that sidejacking depends on; the Secure attribute then keeps the cookie off any unencrypted connection that slips through.

  • HttpOnly: Removes the cookie from JavaScript's reach and reduces XSS-based theft, though it does not stop malware from targeting browser storage.

  • SameSite: Set to Strict, it prevents the cookie from traveling on cross-site requests, while Lax blocks most cross-site requests but still permits certain top-level navigations using safe methods.

  • Domain and __Host- Scoping: Leaving Domain unset and adopting the __Host- prefix confines the cookie to the issuing host, closing a subdomain route to fixation.

  • Strong Session Secrets: According to NIST SP 800-63B, session secrets should use an approved random bit generator with at least 64 bits of entropy, which defeats practical prediction. Applications should also keep session identifiers out of insecure browser storage.

  • Identifier Rotation: Rotating the identifier after authentication defeats fixation, since any identifier planted before login becomes invalid.

  • Short Lifetimes and Logout Invalidation: Short lifetimes and server-side invalidation on logout shrink the replay window for stolen tokens.

  • Content Security Policy (CSP): A strict CSP can limit whether injected scripts execute, but it works best alongside HttpOnly cookies and other XSS defenses.

None of these controls can fully stop an infostealer already running on the endpoint, which is why detection is the next layer of defense.

Replay Signals That Reveal a Transplanted Session

A transplanted cookie often reveals itself through a mismatch between its issuance context and current use. Related signals include impossible travel and a client that suddenly looks different. Would you notice if your own account signed back in from a different country within the same hour? Several signal types can reveal a transplanted session:

  • Location or Network Mismatch: A cookie issued to a browser in one city may suddenly arrive from a different country, or the same effect appears as an internet protocol (IP) address or network change mid-session.

  • Impossible Travel: Two uses of the account come from locations no one could physically move between in the elapsed time.

  • Client or User-Agent Mismatch: A desktop browser that abruptly becomes a command-line client points to a duplicated cookie.

  • Concurrent Use: Simultaneous activity from the same cookie in two locations suggests the session was copied.

  • Activity Without a Recent Login: Session activity with no corresponding authentication event can be a clue, though legitimate long-lived sessions may not have a nearby login either.

  • Post-Authentication Behavior: Bulk downloads, installation of archive tools, large uploads to file-sharing services, new mail forwarding rules, and unexpected administrative changes all fit an attacker using stolen access.

Travel, virtual private networks, mobile connections, and software updates can produce similar signals on their own, so mature detection correlates multiple indicators and compares them with the user's normal behavior rather than treating any single event as proof of compromise.

Revocation and Response That End Unauthorized Access

When compromise looks likely, ending the session everywhere takes priority. According to NIST SP 800-63B, server-side invalidation should terminate active sessions and invalidate their identifiers so stolen copies stop working immediately. A password reset alone may leave existing tokens live, so revocation and credential changes serve different purposes.

A response plan can then address the remaining exposure:

  • Rotate Exposed Secrets: Responders can change the account password and any application programming interface (API) tokens, keys, or application grants the session could reach.

  • Review Recovery Settings: Responders can confirm that recovery email addresses and phone numbers still belong to the user, since attackers may alter them to survive resets.

  • Check for Persistence: The review can cover new mail forwarding rules and added devices. Responders can also identify unfamiliar application authorizations created during the session.

  • Preserve the Evidence: Authentication and activity logs can be retained before they age out so responders can reconstruct the entry point and scope.

  • Audit Account Activity: Responders can review what was accessed, downloaded, or changed while the session remained live.

Applications can also require fresh reauthentication for sensitive actions, such as changing recovery settings or moving money. This adds a checkpoint that a hijacked session cannot pass without the user's authenticator.

Why MFA and Passkeys Do Not Eliminate Session Risk

MFA and passkeys secure the moment you log in; the session cookie the server issues afterward is a separate credential. Passkeys resist phishing because their cryptographic exchange is bound to the legitimate site, but successful authentication still leads the server to issue a session token. The protections applied at login no longer help if an attacker obtains that bearer cookie.

AiTM proxies capture the cookie when it is issued after the victim's successful MFA establishes the session. Infostealers take a different route by lifting the token from a compromised endpoint after login. In either case, the attacker inherits a verified session without repeating authentication.

A further layer of defense ties the session itself to something the attacker cannot copy:

  • Continuous Access Evaluation: Rechecks conditions during the session and allows access to be revoked when risk events occur, such as a location change or account disablement.

  • Device-Bound Session Credentials: Ties the session to a private key stored on the device; the browser periodically proves it still holds the key, so a cookie exported to another machine fails.

  • Proof-of-Possession Schemes: Such as Demonstrating Proof of Possession (DPoP), constrain Open Authorization tokens by requiring a signature from a client-held key.

These approaches complement well-configured cookies and disciplined session management rather than replacing them.

Strong Authentication Needs Strong Sessions

A login lasts a moment, but the session it creates can live for hours or days across networks and devices. Evaluating security means following that entire lifecycle: how identifiers are issued and scoped, where they could be taken, how reuse would be spotted, and how quickly every copy can be invalidated. Combining theft prevention, replay detection, short exposure windows, and rapid revocation can turn a stolen cookie from an account takeover into a short-lived nuisance.

None of this replaces watching the session itself once someone is inside the inbox. Abnormal is designed to help detect the anomalous, post-authentication signals a hijacked email session produces, such as unusual sign-in geography, an unfamiliar device, or a new mail-forwarding rule, using behavioral AI trained on each organization's own identity and communication patterns. It can also help surface risky Microsoft 365 configuration drift before an attacker exploits it. Abnormal was named a Customers' Choice in the 2026 Gartner® Peer Insights™ Voice of the Customer for Email Security.

See a demo to see how it flags hijacked-session behavior, like impossible-travel sign-ins, unfamiliar devices, and newly created mail forwarding rules, before an attacker can act on a stolen cookie.

Frequently Asked Questions

Yes. MFA is checked at login, and the cookie is issued after that check succeeds. An attacker presenting a stolen cookie joins a session that already satisfied the challenge. Phishing proxies capture the cookie during login, while malware takes it afterward.

Is Session Hijacking the Same as Session Fixation?

Session fixation plants an identifier before the victim logs in, and it becomes valuable if the application keeps using it after authentication. Session hijacking takes an identifier from a session someone else established. Issuing a fresh identifier at every login defeats fixation.

Only when the application invalidates the session on the server. If logout merely deletes the browser's local copy, a stolen duplicate keeps working until it expires. Server-side invalidation makes every copy worthless at once.

Can HttpOnly Cookies Still Be Hijacked?

Yes. HttpOnly blocks scripts running in the page from reading the cookie, so it stops one theft path. Malware can still capture the cookie by reading browser data from disk. Unencrypted network interception and phishing proxies can capture it too.

Passkeys make login resistant to phishing. After authentication succeeds, the server still issues a bearer cookie. Malware or a hostile browser extension can steal that cookie afterward. Device-bound session approaches address this gap by tying the session to a device-held key.

Protect Against Evolving Email Threats

See how behavioral AI detects attacks that legacy defenses miss.