Glossary
Session fixation
Definition
Session fixation: A web attack in which an attacker makes a victim's browser use a session identifier the attacker knows, so that if the site keeps that identifier after the victim signs in, the attacker can use the signed-in session (CWE-384).
Also known assession fixation attackCWE-384fixed session attack
In short
Session fixation is a web attack in which an attacker gets your browser to use a session identifier they already know, then waits for you to sign in. If the site keeps the same identifier after sign-in, the attacker's copy then opens your signed-in session. The fix is on the server: issue a fresh session identifier at every sign-in and reject identifiers the server never created.
Key takeaways
- The attacker sets your session ID before you sign in instead of stealing it afterwards.
- It works only if the site keeps the same session ID after you sign in.
- OWASP says regenerating the session ID at sign-in "is mandatory to prevent session fixation attacks."
- Sites should never accept a session ID they didn't generate, or one that arrives in a URL.
- MITRE catalogs the flaw as CWE-384.
Last reviewed 5 December 2026 by Foxcolab Team
Session fixation is an attack in which someone makes your browser use a session identifier they already know, waits for you to sign in, and then uses that same identifier to act as you. In session hijacking, the attacker steals your session ID after you sign in. In session fixation, they choose it beforehand, and the site's mistake is keeping it. MITRE lists the flaw as CWE-384: "Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions."
How it works#
- The attacker visits
https://shop.example.comand receives an anonymous session ID, saySID=8f3a…. - They get your browser to use it, for example with a link like
https://shop.example.com/login?SID=8f3a…on a site that accepts IDs in the URL, or with a script injected through a cross-site scripting flaw that sets the cookie. - You sign in from that page. The site marks session
8f3a…as yours but doesn't issue a new ID. - The attacker sends requests with
SID=8f3a…and is signed in as you.
No password was stolen, and an encrypted connection doesn't help. OWASP notes the defense matters "independently of using HTTP or HTTPS."
How sites prevent it#
The OWASP Session Management Cheat Sheet sets out the rules:
- Issue a new ID at sign-in. "The session ID regeneration is mandatory to prevent session fixation attacks." Do it again after any privilege change, such as a password change or switching to an admin role.
- Be strict. "Web applications should never accept a session ID they have never generated."
- Keep IDs out of URLs. They leak through links, logs and browser history, so refuse IDs that arrive that way.
- Invalidate the old session, so the ID the attacker knows stops working.
The fix is in the site's hands. As a user, you limit the damage by signing out when you finish and ending sessions you don't recognize.
In Foxcolab#
Foxcolab's sign-in service doesn't take a session identifier from the browser. Every time you sign in, it creates a new session with an identifier its own servers generate. Changing your password signs out every other session, signing out in any Foxcolab app ends that session on Foxcolab's servers, and Your devices in the account console lists where you're signed in. See review active sessions, or create a free account.
Keep exploring
Related terms
- Session hijackingSession hijacking is taking over someone's signed-in session by stealing or guessing the token that keeps them logged in. It skips the password and two-step verification entirely.
- Session cookieA session cookie is either a cookie that disappears when the browser session ends or the cookie that keeps you signed in. Here's what each attribute does and why stolen ones matter.
- Cross-site scripting (XSS)Cross-site scripting lets an attacker run their own script inside a trusted website, in other people's browsers. Here are the three types, an example and the defenses that work.
- Account takeover (ATO)Account takeover is when someone else gains control of your account and uses it as you. The routes in are reused passwords, phishing, stolen sessions and recovery.
- Session timeoutA session timeout ends a signed-in session after a period of inactivity or a maximum age. See the two kinds, the limits OWASP and NIST suggest, and why signing out still matters.

Foxcolab
Private work tools, without the ads.
Mail, files, documents, spreadsheets and meetings in one account. Files, documents and spreadsheets are end-to-end encrypted.