Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an iPhone xcode application read cookies previously stored by Safari Mobile?

Tags:

Can an iPhone application read cookies previously stored by Safari Mobile?

like image 201
TonyNeallon Avatar asked Feb 10 '09 12:02

TonyNeallon


People also ask

Does Safari clear cookies automatically in iPhone?

Answer: A: Short of Eric's recommendation to use private browsing, Safari does not offer an automatic means to remove all cookies when it is quit.

Where are cookies stored on iPhone?

To check where are the app cookies stored on iPhone, On an iPhone, go to Settings -> Safari -> Advanced -> Website Data and you will see all cookies stored on your device.

How See cookies Safari iOS?

SAFARI for iOS (iPhone and iPad) Step 1: Go to Settings, then scroll down and select “Safari”. Step 2: Scroll down to “Privacy & Security”. Step 3: Verify “Block All Cookies” is ticked (green/white), click to allow cookies. Step 4: Clear the browser cache and reopen the browser.

Where are cookies Safari stored?

Safari stores it's cookies in ~/Library/Cookies . There you'll find a file named Cookies. binarycookies .


2 Answers

To actually answer your question:

No.

Mobile Safari's cookies are not accessible from SDK apps. And each SDK app is given its own WebKit cache and cookie stores, so while cookies will persist within the same app, they aren't accessible betweeen apps.

like image 104
Marco Avatar answered Oct 21 '22 12:10

Marco


As of iOS 9 this is possible!

Use a sfSafariViewController.

You will need to setup:

  • A custom URL scheme in your app to receive cookie data.
  • The website you are getting cookies from will need to implement an API specific your app's custom URL scheme, to redirect back to your app.

You can clone this repo which has a fully working demo of this.

Hope this helps,

Liam

like image 20
Liam Ferris Avatar answered Oct 21 '22 12:10

Liam Ferris