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"