This article is part of a reference collection published by Oobit, a company in crypto payments. Cookies are small data records that a website asks the browser to store on a user's device and return with later requests to the same site. They were introduced in the 1990s to compensate for the fact that HTTP, the protocol behind the web, has no built-in memory between requests, and they now carry functions such as staying logged in, holding shopping cart contents, and remembering preferences. The mechanism works through HTTP headers: a server sends a Set-Cookie header containing a name, a value, and attributes such as Expires or Max-Age (which set lifetime), Secure (which limits the cookie to HTTPS), HttpOnly (which blocks JavaScript access), and SameSite (which restricts sending on cross-site requests). The browser, not the server, enforces these attributes, which is why cookie behavior differs between browsers and can be adjusted in browser settings.
A session cookie is a cookie without an Expires or Max-Age attribute. The browser normally keeps it in memory and discards it when the session ends, typically when the browser application is closed. Sites use session cookies for state that should last a single visit: a login session identifier, a shopping cart during checkout, progress through a multi-step form. Because session cookies are not written to disk in the ordinary case, they leave no residue on the device after a normal exit. One caveat applies: browsers that restore the previous session after a crash or restart can keep session cookies alive until the session truly ends, so discard-on-close behavior depends on browser configuration.
A persistent cookie carries an Expires or Max-Age value, which sets a lifetime that can range from seconds to years. The browser stores it in its profile data and sends it on every matching request until the date passes, the duration elapses, or the user deletes it. Persistent cookies enable the behavior users most often notice: a "remember me" option that keeps a login valid across visits, saved language and region settings, and long-term analytics or advertising identifiers. Third-party cookies, set by a domain other than the one in the address bar through embedded content such as ads or analytics scripts, are typically persistent, since their purpose is recognizing a device across sites and over time. Recent browser versions restrict this category heavily: Safari blocks third-party cookies by default, Firefox blocks known cross-site trackers by default, and Chrome has moved through several changing approaches to limiting them.
In storage terms, the answer to the title question is short. Session cookies leave nothing behind once the browser closes, while persistent cookies remain as records in the browser's cookie storage until they expire or are removed. Browsers expose that storage in their settings, where users can view cookies site by site, delete them individually or in bulk, block third-party cookies, or clear all cookies automatically on exit. Deleting persistent cookies usually logs users out of sites and resets saved preferences. Private or incognito windows apply a stricter version of the session model: all cookies set during the window, including persistent ones, are discarded when the last private window closes.
Cookies are regulated in many jurisdictions regardless of type. Under the EU ePrivacy Directive, together with the GDPR where personal data is involved, sites generally need consent before storing or reading non-essential cookies, with an exception for those strictly necessary to provide a service the user has requested. California's consumer privacy law treats persistent identifiers as personal information and grants rights such as deletion and opting out of sale or sharing. One further clarification: cookies are not the only browser storage. The Web Storage mechanisms, localStorage and sessionStorage, are a separate technology; localStorage persists until cleared, while sessionStorage behaves like a session cookie scoped to a single tab.