Recent

Author Topic: How are cookies share WebView, WKWebview, NSURLConnection  (Read 1861 times)

MISV

  • Hero Member
  • *****
  • Posts: 804
How are cookies share WebView, WKWebview, NSURLConnection
« on: October 20, 2022, 11:48:46 am »
I have a crawler.

To login I have/intend user to login through an embedded browser. (WebView/WKWebView depending on IS)

The actual crawl may be used using NSURLConnection or WebView/WKWebView

- https://www.xamarinhelp.com/cookie-sharing-webview-http-client/

Quote
In iOS if you are using NSUrlSession, your cookies are shared automatically with the UIWebView/WKWebView and NSUrlSession.

To access the Cookie Container, you just need to call upon NSHttpCookieStorage.SharedStorage.Cookies.

So can anyone point me to some official documentation (somehow hard to find using Google) what combos of cookies are shared on MacOS/OSX?

OR how I would be go around copy cookies :)




trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: How are cookies share WebView, WKWebview, NSURLConnection
« Reply #1 on: February 27, 2023, 05:32:46 am »
Before OS X 10.11, cookies were shared. Since OS X 10.11 and macOS 10.12 they are no longer shared.

See: https://developer.apple.com/documentation/foundation/nshttpcookiestorage

MISV

  • Hero Member
  • *****
  • Posts: 804
Re: How are cookies share WebView, WKWebview, NSURLConnection
« Reply #2 on: April 16, 2024, 11:22:51 am »
Thank you. I will try investigate if possible to copy cookies so when someone logs using WKWebView, I would like to copy the sessions cookies for use for my crawler

Thaddy

  • Hero Member
  • *****
  • Posts: 16145
  • Censorship about opinions does not belong here.
Re: How are cookies share WebView, WKWebview, NSURLConnection
« Reply #3 on: April 16, 2024, 04:59:59 pm »
Cookies are a bad idea in the first place. And not necessary.
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018