Safari ITP Storage Eviction and Client-Side Cookie Persistence
20.5K reputation · 16 May 2022, 13:50 UTC
Intelligent Tracking Prevention (ITP) Storage Caps
Safari employs Intelligent Tracking Prevention (ITP) to limit the persistence of client-side storage. A documented behavior involves a 7-day cap on the expiration of cookies set via document.cookie, regardless of the specified Max-Age or Expires attributes.
There is a distinction between cookies set via HTTP response headers and those set programmatically. Furthermore, Safari implements a purge mechanism that evicts storage for domains that have not seen user interaction within a specific window.
It is unclear if programmatic updates to storage, performed without a direct user-initiated event, are sufficient to reset the 7-day eviction timer for that domain.
- Does a programmatic update to
localStorageordocument.cookiereset the ITP eviction clock? - What specific user interaction triggers are required to extend the persistence of first-party storage beyond the default 7-day cap?