Questions tagged [nshttpcookiestorage]

30 questions
11
votes
2 answers

How is `removeCookiesSinceDate` supposed to be used?

There is this new great method of NSHTTPCookieStorage, available since MacOS 10.10 and iOS 8.0. Guessing from the negligible number of Google hits, nobody much has noticed it yet. Not so surprising, given that it's not yet even in the Apple dev…
Pavel Zdenek
  • 6,883
  • 1
  • 18
  • 37
9
votes
1 answer

SFSafariViewController cookies

I understand that as of iOS9 you should be able to read cookies with SFSafariViewController. If I set a cookie on my page in JS using the following: var dd = new Date(Date.now() + 1000 * 60 * 60 * 24).toGMTString(); var expires = "expires="+…
8
votes
1 answer

Security surrounding the iOS shared NSHTTPCookieStorage

I'm struggling to find the exact details on this, so I'm hoping to get some help here. I'm looking for some information regarding the underlying storage mechanism of the iOS shared NSHTTPCookieStorage: When cookies are stored using the shared…
Stephen Asherson
  • 1,477
  • 14
  • 23
7
votes
1 answer

WKWebView, get all cookies

I want obtain all cookies from WKWebView. Why? I have been started a project that use web-based auth. As result, I should intercept cookies to be sure that user is logged in and for some other purposes. Another case - imagine if user logged in, and…
hbk
  • 9,872
  • 9
  • 82
  • 110
7
votes
0 answers

WKWebView does not process "Set-Cookie" header correctly

I use WKWebView in my project to implement web-based authorisation UI. I use [NSHTTPCookieStorage sharedHTTPCookieStorage] to keep user session cookies of whole app and keep user authenticated in case of WKWebView redirects to our Backend pages. The…
lazarev
  • 829
  • 9
  • 24
6
votes
1 answer

Session is not maintained between UIWebView

In my app I'm trying to login user through UIWebView. On successful login cookies are set in NSHTTPCookieStorage. Few of my app pages are open in UIWebView. When request for particular web page is send, it check whether user is logged in or not…
Ankita Shah
  • 1,958
  • 3
  • 20
  • 39
3
votes
0 answers

Shared NSHTTPCookieStorage will sync persistent cookies to WKWebsiteDataStore defaultDataStore httpCookieStore?

I found an interesting fact that the shared NSHTTPCookieStorage will sync persistent cookies(isSessionOnly=false) to WKWebsiteDataStore.defaultDataStore.httpCookieStore, could anyone tell me if this is a feature or kind of unreliable behavior? No…
Cyme
  • 31
  • 3
3
votes
0 answers

Using HTTPSCookiesStorage can I screen(filter) cookies storage in URLSession?

I have subclassed HTTPCookiesStorage, but the storeCookies() never store the cookies although, i am calling super.storeCookies() within the method. Session stores the cookies automatically if i dont override the configuration with my custom…
3
votes
1 answer

How to listen for cookie being set in iOS NSHTTPCookieStorage?

I'd like to know when a cookie is set in NSHTTPCookieStorage. Is there an on change method or event handler? I'd like to prevent a cookie from being set.
Colin Whitmarsh
  • 326
  • 2
  • 8
3
votes
2 answers

URLSession to use a custom CookieStorage on iOS?

I need a urlsession that stores cookies in a separate cookieStorage In the folllowing code the cookieStorage in urlSession is the same as the shares cookieStorage, is it possible to create a separate cookie store let config =…
aryaxt
  • 69,636
  • 87
  • 281
  • 421
3
votes
2 answers

Sharing session between AFNetworking and UIWebView

Is it possible to share AFNetworking session with UIWebView? I used AFNetworking to login to remote server, but the UIWebView have no idea about the session being created by AFNetworking?
RyanB
  • 1,237
  • 1
  • 9
  • 27
3
votes
1 answer

NSHTTPCookieStorage does not save cookie automatically

I'm recieving cookie in Set-Cookie header of NSURLResponse, but [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies] returns empty list. NSHTTPCookie, which i received from response, is HTTPOnly, secure and has no expiresDate. What can be reason…
2
votes
2 answers

Swift 3: how to check if cookies for particular URL are configured?

I'm building an app for an API with cookie-based validation, and am having several issues with it. My current problem is a function to check if autologin cookie is configured for the domain, but I can't get my head around setting it up properly. My…
michalronin
  • 243
  • 2
  • 12
2
votes
0 answers

WKWebview loosing login cookie

I currently have an issue with hybrid application that uses an WKWebView to display a webpage. After the application restarts and creates a new session / WKWebWiew, a new login cookie is given to the WKWebView from the webservice. This works fine in…
oscar
  • 589
  • 1
  • 4
  • 17
2
votes
1 answer

Delete All Cache and Cookies, Reset an Entire App

I am trying to build an app that has UIWebView. When I exit out of my app, I want all data to reset, including cache and cookies. I am currently able to delete cookies (and probably cache), but the issue is that even after this deletion, some…
NerdyGeek
  • 144
  • 1
  • 7
1
2