Safari ITP and the 7-Day Storage Eviction Rule

This article explains the specific conditions under which Apple's Intelligent Tracking Prevention (ITP) in the Safari web browser deletes all script-writable storage for a website origin after seven days. It outlines the exact user interaction requirements, the types of browser storage affected, how server-side data differs, and the specific exceptions to this seven-day privacy rule.

To prevent cross-site tracking and protect user privacy, Safari enforces a strict seven-day cap on website data. ITP will evict all script-writable storage for an origin after seven days when all of the following conditions are met.

1. The Storage is Created by Client-Side Scripts

The seven-day eviction rule strictly targets "script-writable" storage. This means the data was generated or modified in the browser using JavaScript, rather than being set exclusively by a server via HTTP response headers.

If the condition is met, ITP deletes the following script-writable data types:

  • Client-side cookies created via document.cookie
  • LocalStorage
  • SessionStorage
  • IndexedDB databases
  • Service Worker registrations and the Cache API
  • Web SQL databases (legacy)

(Note: Cookies set via the HTTP Set-Cookie header that are never modified by JavaScript are not subject to this specific script-writable storage eviction, provided they are not flagged by CNAME cloaking defenses).

2. Absence of First-Party User Interaction

The seven-day timer begins the moment the user visits the website and the script-writable storage is created. For the eviction to occur, there must be a complete lack of "user interaction" with that origin as a first-party website for seven consecutive days.

Safari defines user interaction as deliberate action taken on the page—such as clicking a link, tapping a button, or typing in a form—while the website's domain is visible in the main URL address bar. Simply loading the website in the background, or loading the origin's scripts as a third-party iframe on a different website, does not reset the seven-day countdown. If the user interacts with the site on day four, the seven-day timer resets. If they do not return and interact by the end of day seven, the storage is wiped.

For the standard seven-day rule to apply, the user's initial visit must not trigger ITP’s stricter 24-hour eviction rule.

If a user navigates to a website by clicking a link on a domain that ITP has classified as a known cross-site tracker, and that link contains "link decoration" (such as URL query parameters or fragments used for tracking), ITP bypasses the seven-day rule and evicts all script-writable storage after just 24 hours of no interaction. Therefore, the seven-day condition only holds if the traffic source was clean of classified tracker decoration.

4. The Website is Not Installed on the Home Screen

The user must be accessing the website through the standard Safari browser tab environment. If a user on iOS or iPadOS adds the website or Progressive Web App (PWA) to their device's Home Screen, Safari exempts that specific origin from the seven-day storage eviction rule.

Summary of the Eviction Trigger

In short, Safari's ITP will completely erase an origin's client-side storage on the eighth day if:

  1. The data was written via JavaScript.
  2. The user did not arrive via a decorated link from a known tracker (which would trigger a 24-hour wipe instead).
  3. The web app is not saved to the user's Home Screen.
  4. The user has not actively clicked, tapped, or typed on the website as a top-level domain for seven full days.