Recent

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

MISV

  • Hero Member
  • *****
  • Posts: 792
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: 2023
  • 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: 792
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: 14383
  • Sensorship 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.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018