Handle js cookies in WebView
Handle js cookies in WebView
- Subject: Handle js cookies in WebView
- From: Juanjo Conti <email@hidden>
- Date: Tue, 24 Feb 2015 16:07:11 -0300
Hi there!
I'm still trying to have private cookie jars at Max Os X for my app:
http://stackoverflow.com/questions/28456789/separate-cookie-jar-per-webview-in-os-x
At this point, I have translated from objc to swift the BSHTTPCookieStorage
class mentioned in the SO question (to get a better understanding of what's
happening) but still have the original problem: handling of js cookies it
not done correctly.
This is caused because cookies can be written to document.cookie specifying
properties like expiration, httpOnly and secure but when you retrieve them
reading document.cookie you only get name/value pairs.
So the question is: is there a way to hook WebView in order to be notified
when a page write to document.cookie?
My current implementation reads document.cookie on
func webView(webView: WebView!, *decidePolicyForNavigationAction*
actionInformation: [NSObject : AnyObject]!, request: NSURLRequest!, frame:
WebFrame!, decisionListener listener: WebPolicyDecisionListener!)
and make assumptions for the for the cookies properties. This assumptions
works on in some sites, but fail in sites like gmail.com or newrelic.com
Thanks in advance,
--
Juanjo Conti <jjconti <http://goog_2023646312>@carouselapps.com
<email@hidden>>
Software Engineer - Carousel Apps <https://carouselapps.com>
--
Carousel Apps Limited, registered in England & Wales with registered number
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel
App Ltd or any of its subsidiary, holding or affiliated companies or
entities (together "Watu") is confidential and may be privileged or
otherwise protected. If you receive it in error please inform us and then
delete it from your system. You should not copy it or disclose its contents
to anyone. Messages sent to and from Watu may be monitored to ensure
compliance with our internal policies and to protect our business. Emails
are not secure and cannot be guaranteed to be error free. Anyone who
communicates with us by email is taken to accept these risks.
_______________________________________________
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