Two-factor login is one of the best protections a WordPress site can have. It protects the moment of logging in. But after that moment, the browser holds a login cookie, and whoever has the cookie is logged in. No password, no code.
Copying that cookie is called session hijacking, and it has become a common way into well-protected sites.
How cookies get stolen
The main source today is information-stealing malware: programs that hide in pirated software, fake browser updates, cracked plugins or malicious email attachments. Once on a computer, they copy saved passwords and browser cookies and upload them. The stolen cookies are then sold in bulk on criminal marketplaces.
The person whose laptop was infected often notices nothing. Their site’s login cookie is now in someone else’s browser.
Other ways exist (unencrypted Wi-Fi on sites without HTTPS, cross-site scripting in a vulnerable plugin), but stealer malware is the one that scales.
Why the usual protections do not help
- Strong passwords: the attacker never types one.
- Two-factor login: the code was already entered, by the real user, when the cookie was created.
- Changing the password: on its own, it does not end sessions that already exist.
What does help
Tie sessions to devices
The strongest protection is to notice that a session suddenly comes from a different device, and end it. With Keel Pro’s Trusted devices (Login & accounts › Trusted devices):
- End sessions used from another device: if a login cookie shows up on another computer, that session ends at once and you are told.
- Limit new devices until they are confirmed: a new device cannot install plugins, change users or change settings until it is confirmed with a link sent by email. Writing and editing content still works.
The first device of each account is trusted automatically, so nobody is locked out on day one.
Shorter sessions
The shorter a session lives, the less time a stolen cookie is useful. Log out idle sessions after an hour or two for staff accounts, and do not tick “Remember me” on shared computers.
Watch for unusual logins
Alerts for logins from new devices, and for new administrators, tell you within minutes when an account is used somewhere unexpected. See Login alerts, idle logout and sessions.
End every session at once
If you suspect a stolen cookie, change the WordPress security keys. Every login cookie stops working immediately, for everyone. See WordPress salts and security keys.
Protect the computers too
The cookie is stolen from a computer, not from WordPress. For everyone who has administrator access:
- no pirated software, cracked plugins or “nulled” themes, which are a favourite way to spread stealers;
- keep the operating system and browser updated;
- use separate browser profiles for work and personal browsing;
- give people the lowest role that lets them do their job: see User roles and least privilege.
Common questions
Does HTTPS stop session hijacking?
It stops cookies being read on the way, for example on public Wi-Fi. It does not stop malware on the computer copying them from the browser.
Would I notice if my cookie was stolen?
Rarely. That is why alerts for logins from new devices, and ending sessions that move to another device, matter.
Do passkeys solve this?
Passkeys protect the login itself very well. The session cookie created after the login can still be copied, so session protection is still needed.