• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to force WebView to use a separate NSHTTPCookieStorage ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to force WebView to use a separate NSHTTPCookieStorage ?


  • Subject: Re: How to force WebView to use a separate NSHTTPCookieStorage ?
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 30 Nov 2011 14:11:43 +0000

On 30 Nov 2011, at 12:00, Ben wrote:

> I am writing an app which opens up multiple WebView's of the same web site. The problem I'm having is that the website detects that I already have a page open and closes the previously opened page.
>
> So I'm presuming that the method by which it is detecting identical pages is via cookies, and if I can make each WebView use a separate NSHTTPCookieStorage rather than the normal shared singleton, I think I might solve the problem.
>
> Does anyone have any ideas how I would achieve this?_______________________________________________

In short this is rather a pain. There's no way to create a separate NSHTTPCookieStorage instance. What you can do though:

- Use the WebResourceLoadDelegate to modify all outgoing requests:
	1. Create a mutable copy of the request
	2. Tell it not to use the standard cookie system
	3. Apply cookies from your own custom storage. Fortunately the URL loading system provides methods to do this

- When receiving a response, process the cookies and store them in your own custom storage. Again the URL system does provide some convenience methods to do quite a bit of the work.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to force WebView to use a separate NSHTTPCookieStorage ?
      • From: John Joyce <email@hidden>
References: 
 >How to force WebView to use a separate NSHTTPCookieStorage ? (From: Ben <email@hidden>)

  • Prev by Date: How to force WebView to use a separate NSHTTPCookieStorage ?
  • Next by Date: Re: How to force WebView to use a separate NSHTTPCookieStorage ?
  • Previous by thread: How to force WebView to use a separate NSHTTPCookieStorage ?
  • Next by thread: Re: How to force WebView to use a separate NSHTTPCookieStorage ?
  • Index(es):
    • Date
    • Thread