logo
Safari ITP Impact Experiment

Results and Best Practices

In this final part of the experiment, we’ll summarize our findings and provide recommendations for handling Safari ITP in web applications.

Key Findings

1. Third-Party Cookies

2. localStorage and sessionStorage

3. Fingerprinting Prevention

Impact on Web Applications

1. Analytics and Tracking

2. Authentication and Sessions

3. User Experience

Best Practices

// Instead of
document.cookie = "user=123; domain=.example.com";
// Use
document.cookie = "user=123; SameSite=Strict; Secure";

2. Storage Handling

// Check storage availability
function isStorageAvailable() {
try {
const storage = window.localStorage;
const x = '__storage_test__';
storage.setItem(x, x);
storage.removeItem(x);
return true;
} catch(e) {
return false;
}
}
// Use with fallback
if (isStorageAvailable()) {
localStorage.setItem('key', 'value');
} else {
// Fallback to session storage or cookies
}

3. Cross-Site Requests

// Include credentials properly
fetch('https://api.example.com/data', {
credentials: 'include',
headers: {
'Content-Type': 'application/json'
}
});

4. Fingerprinting Alternatives

// Instead of canvas fingerprinting
// Use server-side session management
const sessionId = generateUniqueId();
storeSession(sessionId, userData);

Recommendations

  1. Privacy-First Approach

    • Design applications with privacy in mind
    • Minimize data collection
    • Be transparent about tracking
  2. Graceful Degradation

    • Implement fallbacks for restricted features
    • Test with ITP enabled and disabled
    • Provide alternative solutions
  3. User Communication

    • Inform users about privacy features
    • Explain why certain features may be limited
    • Provide clear privacy policies
  4. Technical Implementation

    • Use SameSite cookie attributes
    • Implement proper CORS headers
    • Consider using Privacy Sandbox APIs

Conclusion

Safari ITP significantly impacts how web applications handle user tracking and privacy. While it may present challenges for some applications, it ultimately benefits user privacy and security. By following these best practices and recommendations, developers can create applications that work well with ITP while respecting user privacy.

Additional Resources