Start your 3-day free trial
Sign up to experience all premium features at no cost.
*Available only to new users. Each user is limited to one trial.


Session hijacking is the abuse of a valid session identifier so that a service treats an attacker as an already authenticated user. The attacker may never learn the password: possession of the active token can be enough until the service expires, rotates, or revokes it.
Key Takeaways
- Authentication proves identity at login; a session token carries that result across later requests.
- A token may be disclosed, captured, predicted, fixed before login, or stolen from a browser or device.
- Password changes do not universally revoke existing sessions; explicit session invalidation matters.
- HTTPS and secure Cookie settings protect important paths, but they cannot fix XSS, malicious extensions, or endpoint malware by themselves.
For the larger account, device, and network model, start with the online security guide.
HTTP requests are independent, so a web service needs a way to remember that the browser already authenticated. It issues a session identifier—often a Cookie—and the browser presents it with later requests. OWASP notes that an authenticated session token is temporarily equivalent to the authentication method used to create it.[1] NIST describes the corresponding session secret as the value that binds the user's software to the service over time.[2]
The attack path is usually:
This is why the security boundary is not only the login page. Session creation, storage, transmission, rotation, expiration, and revocation all matter.
A robust design also separates session continuity from authorization freshness. A token that was valid when issued should not silently preserve access after a role is removed, an account is disabled, or a sensitive factor changes. Services can re-check important authorization state and demand recent authentication for high-impact actions instead of treating every active session as equally trustworthy forever.
| Method | What happens | Primary control |
|---|---|---|
| Token disclosure or capture | A valid identifier leaks through traffic, logs, URLs, referrers, or unsafe storage | HTTPS, secure transport, no tokens in URLs, safe storage |
| Session fixation | The attacker makes the victim authenticate with an identifier the attacker already knows | Reject unissued IDs and regenerate after authentication |
| XSS-based theft or action | Malicious script reads an accessible token or acts through the victim's browser | XSS prevention, HttpOnly, content isolation, reauthentication |
| Malicious extension or malware | Software on the endpoint reads browser data or controls requests | Trusted software, least privilege, endpoint cleanup |
| Token prediction or brute force | Weak or short identifiers are guessed | Cryptographically random high-entropy tokens and detection |
OWASP groups disclosure, capture, prediction, brute force, and fixation under routes that can lead to impersonation. The methods differ, so one defensive control cannot cover all of them.
| Item | Password or passkey credential | Session token |
|---|---|---|
| Purpose | Proves identity during authentication | Represents an authenticated state afterward |
| Typical lifetime | Long-lived until changed or revoked | Usually bounded by idle and absolute timeouts |
| Reuse | May create new sessions | Reuses an existing session directly |
| Best immediate response | Change/recover credential and inspect factors | Revoke sessions and tokens, then secure credentials |
A stolen password lets an attacker perform a new login if other controls do not stop it. A stolen session token can bypass the login step because the service sees an already established session. This distinction also explains why MFA can block a new password-based login without automatically neutralizing a token stolen after MFA succeeded.
The two incidents can still overlap. Malware may steal both stored credentials and browser tokens, or an attacker may use a password to create a fresh session and then preserve that token. Response should therefore follow evidence: revoke active sessions for token risk, rotate exposed authenticators for credential risk, and inspect the endpoint when both may have been collected.
No. Session hijacking is the result: unauthorized use of someone else's session. A man-in-the-middle attack, XSS flaw, malicious extension, unsafe log, or malware infection can be one route to the token.
OWASP states that TLS protects against network interception of session IDs but does not stop token prediction, brute force, client-side tampering, or fixation. HttpOnly can prevent ordinary script access to a Cookie, yet malicious script may still cause authenticated actions from the victim's browser. The threat model must name both the source of token exposure and the service behavior that accepts it.
The password and session database are separate state. Some services destroy all sessions on a password change; others revoke only selected sessions, preserve trusted devices, or require the user to choose “sign out everywhere.”
OWASP recommends regenerating the session ID after authentication and privilege changes, destroying old IDs, and invalidating sessions when appropriate. NIST requires logout and timeouts to invalidate session bindings, but each service implements those controls. Therefore, a user responding to compromise should both change exposed credentials and explicitly revoke unknown or all sessions.
The detailed recovery order is covered in someone logged into my account. Clearing all Cookies may sign you out locally, but it does not necessarily revoke a copied token on the server or another device.
Services need defense in depth:
NIST requires protected channels, logout invalidation, and time limits for session secrets, and advises against insecure browser storage. OWASP adds the practical Cookie, renewal, expiration, anomaly-detection, and fixation controls.
Risk signals should trigger proportionate controls rather than automatic identity claims. A new IP address can result from travel, a mobile carrier, or a VPN; a token appearing concurrently from incompatible clients, followed by recovery or payment changes, is stronger evidence. Good systems preserve enough event history for the user and support team to revoke access without exposing the token itself.
Yes. If an attacker has a valid active token, the service may treat the request as already authenticated. The password may never be presented again during that session.
MFA protects authentication and makes new logins harder. It does not automatically protect a token stolen after the MFA event, so session storage, transmission, expiration, and revocation still matter.
It should invalidate the relevant server-side session when correctly implemented. Logging out only one local device may not revoke other sessions, so use the account's session-management or sign-out-everywhere control.
It removes local browser Cookies and may sign that browser out. A copied token may remain valid elsewhere until the service invalidates or expires it.
Session fixation occurs when an attacker causes the victim to use a session identifier the attacker already knows, then waits for the victim to authenticate. Regenerating the identifier at login breaks that binding.
No. HTTPS protects tokens in transit against network interception when correctly used. It does not stop XSS, malicious extensions, malware, token prediction, unsafe logs, or flawed revocation.
No. Cookies are a standard way to maintain sessions. Risk depends on how the identifier is generated, scoped, transmitted, stored, expired, and invalidated.
Look for unknown active sessions, actions you did not take, changed security settings, or simultaneous use that cannot be explained. Location alone is not conclusive; confirm through official account activity and revoke uncertain sessions.
Disclaimer: This article provides general cybersecurity education, not legal, forensic, or professional incident-response advice.
Sources
Sources checked 4 October 2026.
Related articles:
Sign up to experience all premium features at no cost.
*Available only to new users. Each user is limited to one trial.





