SaltAISaltAI
Age-Restricted Products25 March 20269 min read

Age Verification Cookies: How They Work and Why They Matter

If you sell age-restricted products on Shopify — alcohol, tobacco, vaping supplies, adult content, or even certain supplements — you already know that verifying a customer's age is a legal and ethical

If you sell age-restricted products on Shopify — alcohol, tobacco, vaping supplies, adult content, or even certain supplements — you already know that verifying a customer's age is a legal and ethical obligation. What you might not know is exactly how your store remembers that a visitor has already passed that verification check. The answer lies in something called an age verification cookie, and understanding how it works can directly affect your compliance posture, your customer experience, and your conversion rate.

The problem for most Shopify merchants is that age verification feels like a binary choice: either you annoy every visitor with a pop-up on every page visit, or you do nothing and expose yourself to regulatory risk. Neither option is good for business. Merchants serving customers in the UK, EU, or US face increasingly strict scrutiny around how they gate access to restricted products, and a poorly implemented solution can result in lost sales, legal exposure, or both.

In this post, you will learn exactly what age verification cookies are, how they are set and read during a customer session, what compliance requirements apply to them, and how to configure them intelligently inside your Shopify store. Whether you sell craft gin, CBD oils, or adult novelty products, the practical guidance here will help you build a compliant, friction-minimised experience.

What Is an Age Verification Cookie?

An age verification cookie is a small text file that your Shopify store places in a visitor's browser after they have successfully confirmed they meet your minimum age requirement. Like all cookies, it stores a key-value pair — something like age_verified=true along with an expiry timestamp — and your store reads that value on subsequent page loads to decide whether to display the age gate again. This is fundamentally different from a session cookie, which disappears when the browser closes, because age verification cookies are typically set as persistent cookies that survive across multiple sessions.

The practical consequence for merchants is significant. Without a persistent cookie, a customer who verified their age on Monday would be stopped by the gate again on Tuesday. That kind of friction adds up quickly: research from Baymard Institute consistently shows that unnecessary checkout friction contributes to abandonment rates above 70%, and an age gate that fires repeatedly on returning customers is a textbook example of avoidable friction. A well-configured persistent cookie eliminates that repeated interruption while still capturing the verification on the customer's first visit.

Inside Shopify, these cookies are typically set either through your theme's JavaScript, a custom app block, or a dedicated age verification app. The cookie is written to the visitor's browser at the moment they click "I am over 18" or complete whatever verification method you use, and from that point forward, your store's logic checks for that cookie before deciding whether to render the age gate overlay. The entire process happens in milliseconds and is invisible to the customer if implemented correctly.

How the Cookie Is Set and Read

When a visitor lands on your Shopify storefront for the first time, your age verification logic runs before the main page content becomes interactive. A JavaScript function checks the browser's cookie storage for a specific named cookie — for example, av_verified — and if that cookie is absent or expired, it triggers the age gate overlay. The visitor then interacts with the gate, confirms their age, and a Set-Cookie header (or a JavaScript document.cookie call) writes the verification record into their browser storage with a defined expiry period.

The expiry period is one of the most consequential settings you will configure. A 30-day expiry means returning customers who visit within a month see no gate at all, which is good for conversion but may not satisfy stricter regulatory frameworks. Some UK Licensing Act guidance suggests that periodic re-verification is reasonable, which is why many merchants set expiry windows between 30 and 90 days. Going beyond 90 days without re-verification can be harder to justify to a licensing authority if your practices are ever audited.

Reading the cookie is equally straightforward: every page load runs a lightweight check, the cookie value is found, and the gate is suppressed. What matters for merchants is that this logic is executed early in the page render cycle — before images load, before product descriptions appear — so that non-verified users never glimpse product content they should not see. Apps like AgeGuard handle this timing automatically, ensuring the gate fires at the right moment regardless of how fast or slow the rest of the page loads.

GDPR, PECR, and Cookie Consent Requirements

Here is where many Shopify merchants make a costly assumption: they believe that because an age verification cookie is "functional," it is automatically exempt from GDPR and the UK's Privacy and Electronic Communications Regulations (PECR). That assumption is partially correct but dangerously incomplete. Strictly necessary cookies — those essential to a service the user has explicitly requested — can be set without prior consent. However, whether an age verification cookie qualifies as strictly necessary depends on your specific implementation and the jurisdiction you operate in.

In the UK, the Information Commissioner's Office (ICO) takes the position that cookies used purely to remember a user's own preference or action — such as confirming they are old enough to access your store — can generally be treated as functional cookies that do not require opt-in consent. However, if your age verification cookie is bundled with any analytics, remarketing, or tracking functionality, the entire cookie may require consent. This is a common mistake made when merchants use age verification solutions that piggyback on advertising infrastructure.

For EU merchants operating under ePrivacy Directive rules, the standard is similarly nuanced. The safest practical approach is to document your age verification cookie in your cookie policy, classify it explicitly as functional or strictly necessary, and ensure it collects no data beyond the Boolean verification status and the timestamp. Avoid storing device fingerprints, IP addresses, or behavioural data in the same cookie or the same script that writes it. Keeping the cookie lean protects you legally and keeps your page performance fast.

Device-Level Limitations Every Merchant Should Understand

Age verification cookies work reliably only within a single browser on a single device. A customer who verifies their age on Chrome on their laptop will face the gate again when they open Safari on their iPhone — because the cookie stored in Chrome is not accessible to Safari, and vice versa. This is not a flaw in your implementation; it is a fundamental characteristic of how browser cookies work, and it is actually a feature from a compliance standpoint, because it means verification cannot be trivially shared across devices by different people.

The more practically frustrating scenario for merchants is cookie clearing. A meaningful percentage of privacy-conscious shoppers clear their cookies regularly, either manually or through browser settings like Firefox's "Delete cookies and site data when Firefox is closed." When that happens, the age verification record is erased, and the customer will face the gate on their next visit even though they verified previously. There is no technical workaround for this that does not create its own compliance problems — you cannot reliably persist verification without a cookie or a logged-in account.

The merchant-friendly response to this limitation is to make the age gate itself as fast and frictionless as possible, so that the small percentage of customers who encounter it repeatedly are not significantly inconvenienced. A single-click confirmation gate that loads in under 200 milliseconds is a vastly different experience from a multi-step form requiring date of birth entry. Optimise the gate itself, and the device and cookie-clearing limitations become minor inconveniences rather than conversion problems.

Configuring Expiry and Scope in Your Shopify Store

The two most important technical settings for your age verification cookie are expiry duration and cookie scope. Expiry duration, as discussed, controls how long the verification persists. Cookie scope controls which pages on your domain the cookie applies to — setting the path to / means the cookie is checked on every page, while a narrower path like /collections/spirits would only check on specific collection pages. For most Shopify merchants, a site-wide path is appropriate because restricted products can appear across multiple collections, search results, and featured sections of your homepage.

You should also consider whether your cookie needs to be marked as Secure and HttpOnly. The Secure flag ensures the cookie is only transmitted over HTTPS connections, which all Shopify stores use by default. The HttpOnly flag prevents JavaScript from accessing the cookie directly, which reduces certain cross-site scripting risks — though this setting is only available if the cookie is set via an HTTP response header rather than client-side JavaScript. Many Shopify age verification apps set cookies via JavaScript for simplicity, which means HttpOnly is not available, but this is an acceptable trade-off given the low sensitivity of the data stored.

Conclusion

Age verification cookies are a foundational piece of your compliance and customer experience strategy. They allow your Shopify store to remember a visitor's verified status without repeatedly interrupting their shopping journey, but they come with important nuances around expiry settings, GDPR classification, device limitations, and technical configuration. Getting these details right means your store stays compliant, your customers stay happy, and your conversion rate does not suffer unnecessarily from a poorly timed gate.

The key takeaways are simple: use persistent cookies with a 30–90 day expiry, document them accurately in your cookie policy, keep them lean with no tracking data bundled in, and optimise the gate itself for speed and simplicity. Next steps: audit your current age verification setup, check your cookie policy for accurate classification, and consider whether a purpose-built solution handles the edge cases your current theme setup might miss.

Try AgeGuard free at saltai.app — no credit card required.

SaltAI Team

SaltAI builds focused Shopify apps for food merchants and general merchants. Every app is tested in production at a real food store — including Vanda's Kitchen — before it ships.