Session hijacking
In plain terms
When you log in, the site hands you a token proving it's really you, so it doesn't have to ask for your password on every page. Whoever steals that token gets in as you — no password, no verification code.
Definition
Session hijacking is a third party's reuse of the authentication token issued to a user after they log in, which grants access to the account without going through authentication again.
How it works
Authentication happens only once: after that, the browser presents a session cookie with every request, and that's what's taken as proof. This token is therefore the equivalent of an already-validated badge. It can be retrieved in three ways: by software installed on the machine that reads what the browser stores, on a network where traffic isn't encrypted, or through a malicious page that manages to leak it. The notable fact is that the theft bypasses authentication rather than confronting it: neither the password nor the second factor comes into play, since both have already been presented. This is what makes revoking sessions — not changing the password — the measure that actually ends access.
Why it works
People think the password and the code protect the account at every moment, when they only guard the way in. Staying logged in is convenient, and nobody reviews their list of sessions.
What this attack relies on
Understanding these levers is worth more than memorizing a hundred pages: it is what lets you recognize a scam no one has described yet.
Warning signs
- An active session from a device or location you don't recognize
- Actions taken on your account without a new login prompt
- An unexpected disconnection followed by abnormal activity
- No two-factor authentication code received, even though a login did happen
- Account settings changed without any password having changed
Example
Fictional example — no real organization or address
A social network's security settings, opened after a post you didn't write.
Where you're logged in: • This phone — active now • Laptop — yesterday • Browser on Linux — active 10 minutes ago, unknown location Login history: no new logins.
What gives it away
- An active session is unknown, while the history shows no new login.
- No two-factor code was requested.
- Something was done in your name without your password changing.
How to verify
Open the list of sessions or connected devices in the account's settings: that's where the hijacking is visible, and nowhere else. An unknown entry appears there with its date and approximate location, even while the login history shows nothing unusual — since no new login took place.
The questions to ask, in order
Does the session list include a device or location you don't recognize?
If yes: Sign out of all sessions, on all devices, before anything else.
Was something done in your name with no visible new login?
If yes: After signing out everywhere, change the password and check the recovery addresses.
Do browser extensions or third-party apps have access to the account?
If yes: Remove the ones you don't recognize.
What to do
Close your sessions on shared devices instead of just closing the tab. Avoid staying logged in indefinitely to sensitive services, and be wary of browser extensions, which can read what the browser stores.
If it already happened
Revoke all active sessions, on every device, before anything else — it's the only action that invalidates the stolen token. Then change the password, which in most services also forces reauthentication. Finally, check forwarding rules, recovery addresses, and authorized third-party apps.
So it doesn't happen again
- Sign out on shared devices instead of just closing the tab.
- Avoid staying logged in indefinitely to sensitive services.
- Install few browser extensions.
Test yourself on a neighboring attack
There is no simulation for this attack itself. This one is close to it: A code arrives without you asking for anything, and the phone rings right after.
Simulation: Two-factor authentication bypassFrequently asked questions
- Wasn't two-factor authentication supposed to prevent this?
- It protects the moment of login, and the token is issued after that moment. An attacker replaying a session doesn't need to log in: they present an authentication that's already been completed. That's why the fix is revocation, not an extra factor.
- Doesn't the browser's padlock protect my cookies?
- Encrypting the connection prevents reading the traffic between your device and the site, which rules out interception on a network. It doesn't protect against software installed on your machine, which reads the cookie where it's stored, after decryption.
Related attacks
Official sources
This article is part of the Credentials and accounts family. Last updated: 2026-09-02.
Published under the responsibility of Mountaga Diallo · methodology.