question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cross-site Tracking (IOS)

See original GitHub issue

Bug description: According to documentation, there is props thirdPartyCookiesEnabled which is responsible for enabling/disabling third-party cookies on Android, on IOS third-party cookies is enabled by default: thirdPartyCookiesEnabled I’ve found a website that can check third-party cookies in the browser: check third-party cookies. So If I set thirdPartyCookiesEnabled WebView in Android application works as I expected, the website shows that third-party cookies are enabled. But WebView in IOS application shows that third-party cookies aren’t enabled.

Safari browser by default also doesn’t accept third-party cookies, but in the settings, there is a param: prevent Cross-site Tracking if I turn in off Safari will start to accept third-party cookies.

Tested it on Simulator iPhone 11 (13.4)

To Reproduce:

<WebView source={{uri: 'https://whatismybrowser.com/detect/are-third-party-cookies-enabled'}}
         domStorageEnabled={true}
         thirdPartyCookiesEnabled={true}/>

Expected behavior:

WebView IOS accepts third-party cookies in the same way as Android.

Mybe related question (without correct answer): thirdPartyCookiesEnabled on iOS

Environment:

  • OS: IOS
  • OS version: 13.4
  • react-native version: 0.62.2"
  • react-native-webview version: 10.3.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:15

github_iconTop GitHub Comments

1reaction
nickviragdesigncommented, Nov 24, 2020

This seems to be related to the WebKit feature, Intelligent Tracking Prevention (ITP). I found that when I add NSCrossWebsiteTrackingUsageDescription to the info.plist file, this triggers a switch to appear in the application’s device settings. The switch label is “Allow Cross-Website Tracking.” After setting this to switch to TRUE, third party cookies began working as expected in iOS 14.

The problem I’m experiencing now is that I am unsure how to programmatically check the state of this switch from within the app. I need to know the state of the switch in order to decide whether or not the user can successfully authenticate. The app relies on cookie storage in order to authenticate from within the webview (I don’t have any control over the client’s authentication method). WebKit mentions that you can use document.hasStorageAccess(), but this always returns true, regardless of the state of the switch. So it seems to be highly inaccurate.

https://stackoverflow.com/questions/64897054/using-nscrosswebsitetrackingusagedescription-to-request-user-disable-itp-for-wkw

0reactions
edgaraskazlauskascommented, Jul 5, 2022

Issue is still present

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Prevent Cross-Site Tracking in Safari on iPhone
Here's a step-by-step procedure to turn off website-based tracking on iPhone. Step 1: Open the Settings app. ... Step 2: Select Safari. ......
Read more >
Safari in iOS 11: Enabling Cross-Site Tracking Prevention to ...
Safari in iOS 11: Enabling Cross-Site Tracking Prevention to Protect Your Privacy · Open the Settings app. · Scroll down to Safari and...
Read more >
How do I enable Cross-Site Tracking on an iPad?
1. Open the 'Settings' app on the iPad. · 2. Scroll down and select the Safari app in the left menu. · 3....
Read more >
How to enable Cross Site Tracking - Create.net
How to enable Cross Site Tracking · Go to Settings · Click on Safari · Privacy & Security · Turn the toggle 'Prevent...
Read more >
How to Enable/Disable Safari Prevent Cross-Site Tracking
Learn how you can enable or disable Safari Cross - site tracking on iPhone 12 / iPhone 12 Pro.Gears I use:Velbon Sherpa 200...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found