COOKIE BASICS
Session vs. persistent cookies: what changes?
Understand how long cookies last, why closing your browser may not remove them, and when clearing site data helps.
The short answer
Session cookies have no explicit expiry date. Persistent cookies have a set lifetime and can remain between visits. Neither label tells you whether a cookie is useful, invasive, or safe.
The difference at a glance
| Question | Session cookie | Persistent cookie |
|---|---|---|
| Expiry rule | No explicit expiry | A date or maximum age |
| Between visits | Depends on browser session handling | Can remain until it expires or is removed |
| Possible use | A temporary shopping session | A remembered language choice |
| Always a tracker? | No | No |
A shop might use a short-lived identifier to connect the pages you visit with your cart. It might separately remember that you prefer prices in euros. These are different jobs; cookie lifetime is only one design choice.
Does closing the browser delete session cookies?
Not reliably. Browsers define when a session ends, and session restore can bring cookies back along with your tabs. Closing one tab is not the same as ending a browser session.
A cookie with an Expires date or Max-Age lifetime is persistent. The browser can remove it sooner, and a website can replace it on a later visit. See MDN’s Set-Cookie reference.
Cookie lifetime and login lifetime are different
A cookie often contains an identifier rather than your account details. The website checks that identifier against its own records. It can stop accepting a login even while the cookie remains in your browser.
For example, a banking site might ask you to sign in again after inactivity, while still remembering your language. Conversely, a “remember me” feature can keep you signed in between browser sessions. The name session_id alone does not establish how long a cookie lasts. MDN explains how cookies and sign-in state work.
When should you clear cookies?
If one website repeatedly fails to sign you in or shows the wrong preferences, start by removing data for that website. This is less disruptive than clearing every site at once. Expect to sign in again, and make sure you know how to recover the account first.
Firefox lets you manage individual sites or clear cookies and site data together. Pay attention to the selected data categories: clearing cached files is a different operation. Follow Mozilla’s site-data instructions, or use our browser shortcuts.
For a privacy decision, ask what the cookie does and who receives its identifier. Compare first-party and third-party cookies next.
Common questions
Is a persistent cookie malware?
No. “Persistent” describes storage duration, not malicious behavior. A saved display preference and an advertising identifier can both be persistent.
Will clearing cookies delete my account?
Removing a browser cookie is not an account-deletion request. Use the service’s account controls if you want the account and associated data removed.
Which cookies should I worry about most?
Look at purpose and access, not just age. A short-lived sign-in cookie can be sensitive. Our cookie theft guide explains why.
