This guide covers how Browsers Get Hijacked.

You log in correctly — right password, right code, maybe even a passkey — and an attacker still ends up inside your account without ever logging in. The usual explanation is session theft: after you authenticate, the site gives your browser a session cookie, and whoever presents that cookie is treated as you. This article explains, from OWASP, Google, and FIDO Alliance primary materials, how that handoff works, how the cookie gets stolen, and the defenses that actually shrink the risk.
The session is the prize after login
Authentication proves who you are once. A session keeps you logged in afterward. OWASP’s Session Management Cheat Sheet puts the stakes plainly: an authenticated session identifier is temporarily equivalent to the strongest authentication method used to establish the session. In practice, sites store that identifier in a cookie, and the browser sends it automatically with each request. Steal a still-valid copy — through malware that reads browser storage, a cross-site scripting flaw, a leaked log, or a phishing proxy that relays your real login and keeps the resulting cookie — and the server may accept it without asking for your password or passkey again.
Why passkeys help — and where they stop
Passkeys, built on FIDO2 and WebAuthn, are origin-bound: the authenticator signs a challenge only for the genuine site, so a look-alike page cannot collect a usable credential, and there is no shared secret for a breached database to leak. That closes the credential-phishing door. It does not, by itself, protect the session created after a successful login. If that session is a long-lived, replayable bearer cookie and it is copied, the attacker is reusing your authenticated session, not breaking your passkey. The honest summary: passkeys protect sign-in; session design and device hygiene protect everything after sign-in.
The cookie flags that limit the damage
Google’s cookie documentation and OWASP’s guidance describe the same core settings for session cookies:
- Secure — the cookie is sent only over HTTPS, so it is not exposed on plain-HTTP requests.
- HttpOnly — JavaScript cannot read the cookie through
document.cookie, which helps against cookie theft through scripting attacks. - SameSite — controls whether the cookie rides along on cross-site requests;
Strictis the tightest,Laxis the common default, andNonerequiresSecure. - Short lifetime and rotation — sessions should expire, be renewed after login and privilege changes, and be revocable, so a stolen copy has a short useful life.
No single flag stops malware already running on your device from abusing a live session — which is why the user-side habits below matter as much as the site-side settings.
What to do on your own accounts
- Prefer passkeys where offered, and keep a strong, unique password plus two-factor authentication where they are not.
- Treat unexpected “verify” pages as hostile. A proxy that relays a real login can harvest the session at the end of it; navigate to important sites yourself instead of following login links in messages.
- Keep the browser and operating system updated, and run reputable anti-malware. Infostealer malware that copies cookies is a device problem first.
- Use the site’s “sign out all devices” / active-sessions page after any scare, change the password, and revoke unknown sessions — that invalidates stolen copies instead of waiting for them to expire.
- Log out on shared machines, and lock your own. A live session on an unlocked browser is an open account.
- Be suspicious of extensions and downloads. Anything that can read your browsing can reach for your sessions.
The honest limits
Defenses layer; none is absolute. HttpOnly does not stop injected script from acting inside your session, SameSite does not stop same-site attacks, and a passkey does not disinfect a compromised device. Sites carry their share too: short-lived, bound, revocable sessions are a design choice only the service can make. What you control is the combination — phishing-resistant login, a clean device, and fast revocation when something looks wrong.

The bottom line
Browser hijacking is rarely about guessing your password. It is about stealing the proof that you already logged in. Use passkeys, keep the device clean, distrust relayed login pages, and know where each important service lists your active sessions — so if a cookie ever walks away, you can kill it before it is used.
By Karl Amber
Sources
- OWASP Session Management Cheat Sheet — a session identifier is temporarily equivalent to the strongest authentication used to establish it; session generation, lifetime, renewal, and revocation guidance.
- Google Privacy Sandbox, Cookie attributes —
Secure(HTTPS only),HttpOnly(JavaScript cannot access the cookie),SameSite(Strict/Lax/None, withNonerequiringSecure), and session-cookie behavior when no expiry is set. - FIDO Alliance, FIDO2 / WebAuthn and passkeys materials — origin-bound public-key credentials, no shared secret, phishing-resistant sign-in.
- CISA phishing guidance — recognizing and reporting phishing and adversary-in-the-middle lures.
Editor’s note: this article is part of ScanderLoud’s Cybersecurity & Networking series. It was researched from OWASP, Google, and FIDO Alliance primary materials — our coverage is original and defensive throughout.
That is the complete picture on how Browsers Get Hijacked.
Featured image: Nifl99 (talk · contribs), MIT, via Wikimedia Commons



























