Safari 7 day script storage deletion
Safari deletes a site's script written storage after 7 days of Safari use without a visit to the site.
In one line
Can't keep script saved data in Safari after 7 days of use without a visit
Safari deletes a site's script written storage after 7 days of Safari use without a visit to the site.
Covers localStorage, IndexedDB, Cache, service workers, media keys and script set cookies. The counter is days of Safari use, not calendar days. Installed Home Screen web apps are exempt. Limits long lived tracker storage.
What it can and can't do
What the user does: Nothing. Safari does it for you in the background.
It can
- Keep data for as long as you visit the site at least once every 7 days of Safari use
- Keep data when it is added to your Home screen as an app
- Keep cookies set by the site's server, as opposed to its scripts
It cannot
- Keep script saved data, such as localStorage, IndexedDB and cookies set by scripts, after 7 days of Safari use without a visit
- Get around the limit by asking Safari
- Be affected the same way in Chrome or Firefox
How it differs between platforms: Safari on iPhone and Mac only. Chrome and Firefox do not do this.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Not supported | Not available | Not listed | None |
| Edge | Not supported | Not available | Not listed | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Supported | 13.1 | 2020-03-24 | None |
| Safari on iPhone | Supported | 13.4 | 2020-03-24 | None |
| Chrome on Android | Not supported | Not available | Not listed | None |
| Samsung Internet | Not supported | Not available | Not listed | None |
How a site asks for it
| API | Browser behaviour; no site API |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Deleted when Safari use passes 7 days with no user interaction on the site |
| How to take it back | Clear site data, browser privacy settings |
| Inside an iframe | Not listed |
Data you get
What comes back: No data exposed
Shape: none
How often: n/a
No individual data fields. The signal is the access itself.
Technical limits
- Counts days Safari was used
- Home Screen web apps have no cap
- Server set first party cookies are not covered unless cloaked or IP mismatched
- Interaction (tap or click) resets the clock
The story
What it is
Safari erases a site's script stored data if you skip the site for 7 days of Safari use.
For you
If you do not visit a site for a week of Safari use, it may forget you. You might have to log in again or lose a saved score or setting.
For makers
It shortens the life of trackers that hide IDs in storage. It also cuts the life of honest sites, so makers rely on server side cookies or ask people to install the web app to avoid it.
Where you see it
| Type | Example | Apps |
|---|---|---|
| ads | A tracker that kept a visitor ID in local storage loses it after a week away, so Safari users look new on return. | None named |
| games | A casual browser game loses a local save if you skip a couple of weeks, unless you sign in or install it. | None named |
| shopping | A store forgets your wishlist stored in the browser if you do not come back soon. | None named |
| analytics | A measurement team sees Safari visitors counted as new more often, because the ID expired. | Google Analytics |
| productivity | A note app on Safari asks you to sign in or install it so offline notes are not removed. | None named |
| media | A news site loses your reading list kept in local storage after a week away. | None named |
Risks
- Data loss
- Breaks long term stats
What the platform says
- WebKit: Full third party cookie blocking and more. Apple announced Safari limits on script written storage as part of its work against cross site tracking.
- WebKit: Tracking Prevention. Apple describes Safari's tracking protections, including how long some site data lives.
Good uses and abuse
Legitimate uses
- Privacy protection
Known abuse
- Not applicable
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2019-09, Safari 13: ITP 2.3 introduced storage caps
- 2020-03, Safari 13.1: 7 day cap on all script writable storage
Related capabilities
Related
- localStorage. Can keep up to about 5 MB of text notes per site, until cleared
- IndexedDB. Can keep gigabytes of organized data for its own site in your browser
- Service worker lifetime. Can keep a background helper script for a site that stays after you close the tab
Sources
How well checked: Checked against real behavior.