Search code examples
ioscookiescapacitor

how to make the third party cookies in capacitor project to work for ios


I m working on a capacitor project that uses wkwebview, facing issue in writing cookies with ios, android works fine. Adding this to config file didn't work,

"server": {
    "hostname": "subdomain.example.com"
  }

Please advise me if i m missing out something.


Solution

  • As of iOS 14, you cannot use 3rd party cookies by default. Add the following lines to your Info.plist file to get better support for cookies on iOS. You can add up to 10 domains.

    WKAppBoundDomainswww.mydomain.comapi.mydomain.comwww.myothercooldomain.com

    source: https://capacitorjs.com/docs/apis/cookies