Skip to main content
Category: Cookie Types

Session Cookies

Also known as: transient cookies
Simply put

Session cookies are temporary files a website stores in a visitor's browser that last only for a single browsing session and are deleted when that session ends. They are commonly used to keep track of a user's activity in real time, such as items in a shopping cart or a logged-in state, while the user moves through a site. Whether they require consent depends on their purpose and the applicable legal regime, not simply on their temporary nature.

Formal definition

A session cookie is a cookie set without a Max-Age or Expires attribute, meaning it is not persisted to a fixed expiry date and is deleted when the browser determines the current session has ended (the exact timing is browser-defined). Functionally, session cookies support session management, maintaining state across HTTP requests for purposes such as authentication tokens, cart contents, and user preferences during a single visit. From a compliance standpoint, the consent status of a session cookie is determined by its purpose rather than its lifespan: under the EU ePrivacy rules, cookies strictly necessary for a service the user has requested (for example, maintaining a login session or cart) are generally exempt from prior consent, whereas session cookies used for analytics, advertising, or other non-essential purposes typically require prior consent. Requirements differ across jurisdictions such as the EU, the UK, and individual US states, so the classification and consent treatment of any given session cookie should be assessed against the applicable framework and its actual function.

Why it matters

Session cookies sit at the heart of everyday web functionality, keeping a user logged in, preserving the contents of a shopping cart, and maintaining state as a visitor moves through a site during a single visit. Because they are temporary and deleted when the browsing session ends, they are sometimes assumed to be low-risk or automatically exempt from consent requirements. That assumption can create compliance gaps, because under EU ePrivacy rules the consent status of a cookie is generally determined by its purpose rather than its lifespan.

Who it's relevant to

Privacy officers and data protection professionals
Those responsible for cookie audits and consent classification need to recognize that a cookie's temporary nature does not, on its own, determine whether consent is required. Session cookies must be mapped to their purpose, since a strictly necessary login or cart cookie is generally exempt under EU ePrivacy rules while an analytics or advertising session cookie typically requires prior consent, and treatment may differ across the EU, the UK, and individual US states.
Web developers and engineers
Developers implement session cookies by omitting the Max-Age or Expires attribute so the cookie is deleted when the browser determines the session has ended. They should be aware that the browser defines when a session ends, and that the technical implementation must be paired with an accurate purpose classification so that non-essential session cookies are gated behind consent where the applicable framework requires it.
Legal counsel and compliance teams
Counsel assessing cookie compliance should evaluate each session cookie against its actual function and the applicable regime rather than relying on its short lifespan. Because consent obligations vary between the EU, the UK, and individual US states, and because guidance evolves, the classification of a given session cookie may be contested and should be documented with reference to the specific framework in scope.
Marketing and analytics teams
Teams deploying analytics or advertising tools should note that session cookies used for these non-essential purposes typically require prior consent under EU rules, even though they expire at the end of the session. They should coordinate with privacy and legal colleagues to ensure such cookies are only set after valid consent where required, rather than assuming transient cookies are exempt.

Inside Session Cookies

Temporary storage duration
Session cookies are stored only for the duration of a browsing session and are typically deleted when the user closes the browser, distinguishing them from persistent cookies that remain on the device for a defined period.
Session identifier
They commonly hold a session ID that allows a website to associate a series of requests with a single user's session, for example to maintain login state or the contents of a shopping cart across pages.
Functional purpose
Session cookies are often used to enable core site functionality, though this depends on their actual use; the same technical format can also be deployed for analytics or other non-essential purposes.
Legal treatment under the ePrivacy regime
In most EU jurisdictions, whether a session cookie requires consent depends on its purpose, not its temporary nature. The ePrivacy Directive (and national implementations) governs placing or accessing information on a device, and consent exemptions generally apply only to cookies strictly necessary to provide a service explicitly requested by the user.
Relationship to the GDPR
Where a session cookie processes personal data, such as an identifier linked to an individual, the GDPR may also apply to that processing. Compliance under the ePrivacy rules does not automatically satisfy GDPR obligations, and vice versa.

Common questions

Answers to the questions practitioners most commonly ask about Session Cookies.

Are session cookies always exempt from consent because they are temporary?
No. The temporary lifespan of a session cookie does not determine whether consent is required. Under the ePrivacy Directive and its national implementations, the exemption from consent generally depends on whether the cookie is strictly necessary to provide a service explicitly requested by the user, not on how long it persists. A session cookie used for analytics, advertising, or other non-essential purposes typically still requires prior consent in most EU jurisdictions, even though it expires when the browser session ends. Conversely, some strictly necessary functions may rely on session cookies that are exempt. The duration is not the deciding factor.
Does a session cookie avoid data protection rules because it disappears when the browser closes?
Not necessarily. Two separate legal regimes may apply. The ePrivacy rules govern the placing of and access to information on the user's device, and they apply regardless of whether the stored information is personal data. Separately, if a session cookie involves processing of personal data, the GDPR may also apply for as long as that processing continues. The fact that the cookie itself is deleted at the end of the session does not automatically remove either set of obligations, and any personal data already processed may remain subject to the GDPR. The scope of these obligations depends on facts not resolved by the cookie's lifespan alone.
How can I tell whether a specific session cookie needs consent?
The practical starting point is to assess the purpose of the cookie rather than its type or duration. In most EU jurisdictions, ask whether the cookie is strictly necessary to deliver a service the user has explicitly requested, such as maintaining login state or preserving items in a shopping cart. If it serves analytics, advertising, or other non-essential functions, prior consent is generally required. This purpose-based assessment is a legal judgment informed by applicable national guidance, and requirements differ under other regimes such as the UK rules or US state privacy laws, so the analysis should account for the jurisdictions where your users are located.
Should session cookies be blocked before a user gives consent?
For session cookies that require consent under EU rules, the general expectation is that they should not be set until the user has given valid consent through a clear affirmative action. Strictly necessary session cookies may be placed without consent. In practice, this means distinguishing essential from non-essential session cookies in your prior-blocking configuration, so that only exempt cookies fire before a consent decision. A consent management platform can help enforce this distinction, but the underlying categorization of each cookie remains a matter of legal judgment rather than a function the tool decides for you.
How should session cookies be documented in a cookie inventory or notice?
As a practical matter, session cookies are typically listed in the cookie inventory and cookie notice alongside persistent cookies, with their purpose, the fact that they expire at the end of the session, and their categorization (for example strictly necessary versus analytics). Providing this information supports the informed element of valid consent under the GDPR and the transparency expected under EU rules. The specific presentation and level of detail may vary by jurisdiction and by the guidance of the relevant data protection authority, so the notice should reflect the scope of your operations.
Do consent logging and record-keeping obligations apply to session cookies?
Where a session cookie relies on consent, the general practice in most EU jurisdictions is to record that consent, including what the user agreed to and when, so that consent can be demonstrated. This record-keeping obligation is tied to the consent itself rather than to the persistence of the cookie, so the fact that the session cookie is deleted at the end of the session does not remove the need to retain the underlying consent record. A consent management platform commonly performs this logging, but it supports rather than substitutes for the organization's own compliance judgment.

Common misconceptions

Session cookies never require consent because they expire when the browser closes.
The consent position generally depends on purpose rather than lifespan. A session cookie may be exempt only if it is strictly necessary for a service the user has explicitly requested; a session cookie used for analytics or advertising would typically require prior consent in most EU jurisdictions.
Session cookies are always essential or strictly necessary cookies.
The temporary nature of a session cookie does not make it essential by default. Whether it qualifies as strictly necessary depends on its actual function, and non-essential session cookies exist.
The rules that apply to session cookies apply the same way everywhere.
Obligations vary by jurisdiction. EU and UK approaches generally rely on prior consent for non-essential cookies, while several US state frameworks such as the CCPA and CPRA in California often rely on opt-out mechanisms. Scope should always be checked against the applicable regime.

Best practices

Classify each session cookie by its actual purpose rather than its expiry, and document why any cookie treated as strictly necessary meets that standard in the relevant jurisdiction.
Obtain prior consent for session cookies used for non-essential purposes such as analytics or advertising where required under EU and UK rules, and rely on a clear affirmative action rather than pre-ticked boxes or implied consent.
Maintain a cookie inventory that records each session cookie's name, purpose, and legal basis, and keep consent logs to support record-keeping obligations under the GDPR.
Assess whether a session cookie processes personal data, and address ePrivacy and GDPR obligations separately rather than assuming compliance with one satisfies the other.
Adapt consent handling to the applicable jurisdiction, applying opt-in approaches where required in the EU and UK and opt-out mechanisms, including Global Privacy Control signals where relevant, for US state frameworks such as the CCPA and CPRA.
Use a consent management platform to support disclosure and consent handling, while treating it as a support tool that does not replace independent legal judgment about a given cookie's lawfulness.