Handling Safari's 7-Day Cookie Limit with the Storage Access API
Safari's ITP limits third-party cookies to 7 days, breaking long-term analytics. Learn how to use the Storage Access API and user gestures to maintain persistent user identities.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Safari's ITP limits third-party cookies to 7 days, breaking long-term analytics. Learn how to use the Storage Access API and user gestures to maintain persistent user identities.
Safari blocks third-party cookies by default under ITP 2.3. Learn how the Storage Access API restores limited access after a user gesture, and how to test the behavior in Safari 15+.
Safari's ITP partitions third-party cookies by top-level site, breaking embeds that assume global storage. Learn how to diagnose partitioned cookies and use the Storage Access API to restore legitimate access.
Context Firefox's Total Cookie Protection (TCP) partitions cookies and site data per top-level site. The Storage Access API ( document.requestStorageAccess() ) allows embedded cross-origin iframes to request access to their unpartitioned storage, but the specification requires a user gesture (transient activation) for the promise to resolve. Unresolved behav
The goal is to maintain a cross‑site authentication flow that relies on a session cookie set on a third‑party domain (e.g., api.auth‑provider.com) while the user interacts with the main application (app.example.com). The cookie is set with SameSite=None to allow cross‑origin requests, and the server returns it over HTTPS. In local development the request ori
Integration boundary A web app embeds a cross-site authentication flow where a frontend on one origin sets SameSite=None; Secure cookies for an API on another. On localhost everything works: cookies are stored and sent as expected. Once deployed to production domains over HTTPS, Safari stops sending the cookies and the session appears lost. Constraints and u
ITP and Storage Access API Behavior The objective is to determine the precise persistence behavior of cookies within Safari's Intelligent Tracking Prevention (ITP) framework. ITP utilizes on-device machine learning to block trackers and caps first-party cookies set via JavaScript to a 7-day expiration for users who do not interact with the site. For third-pa