Is there a way to pass cookies from my application to SFSafariViewController

Documentation states that SFSafariViewController will use 'Safari' cookies. But is it possible to also pass cookies from my application in addition ?

Accepted Reply

No.

Replies

No.

Hi,


What if I append some queries parameters in URL open that url in SFSafariViewController. Page opended in safari parse those query params and store it as cookie.


Is this a valid way to get cookie stored from app using SFSafariViewController??

Is this a valid way to get cookie stored from app using SFSafariViewController??

No. Really, we mean it (-:

To expand on mitzpettel’s response, the goạl of SFSafariViewController is to act Just Like Safari™. To do this it has to have access to lots of state that the user might consider private (like their cookies), and the only way that makes sense to allow is if we isolate your app from the user state of SFSafariViewController.

If you want a web view whose user state your app can ‘see’, consider using WKWebView.

For more background on the relationship between SFSafariViewController and WKWebView, check out WWDC 2015 Session 504 Introducing Safari View Controller.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"