You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/10/13 06:44:22 UTC

mac commit: CB-9581 OSX WebView does not send cookies is safari cache is cleared

Repository: cordova-osx
Updated Branches:
  refs/heads/master 5d5359ca7 -> c18759f9b


CB-9581 OSX WebView does not send cookies is safari cache is cleared

This closes #23


Project: http://git-wip-us.apache.org/repos/asf/cordova-osx/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-osx/commit/c18759f9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-osx/tree/c18759f9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-osx/diff/c18759f9

Branch: refs/heads/master
Commit: c18759f9bff820e56414b379c4899bbe5c0b0742
Parents: 5d5359c
Author: Tobias Bocanegra <tr...@adobe.com>
Authored: Thu Sep 17 22:35:32 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Oct 12 21:43:57 2015 -0700

----------------------------------------------------------------------
 .../CordovaLib/Classes/CDVViewController.m      |  1 +
 .../CordovaLib/Classes/CDVWebViewDelegate.m     | 50 ++++++++++----------
 2 files changed, 26 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/c18759f9/CordovaLib/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVViewController.m b/CordovaLib/CordovaLib/Classes/CDVViewController.m
index 1d78e6c..35f86b2 100644
--- a/CordovaLib/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/CordovaLib/Classes/CDVViewController.m
@@ -94,6 +94,7 @@
     [self configureWindowSize];
     [self configureHideMousePointer];
     [self.webView setPreferences:prefs];
+    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
 }
 
 - (void)__init {

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/c18759f9/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m b/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m
index 85cef5a..d318946 100644
--- a/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m
+++ b/CordovaLib/CordovaLib/Classes/CDVWebViewDelegate.m
@@ -21,18 +21,18 @@
 #import "CDVWebViewDelegate.h"
 #import "CDVConsole.h"
 #import "CDVBridge.h"
-#import "CookieJar.h"
+// #import "CookieJar.h"
 
 @implementation CDVWebViewDelegate
 
-CookieJar *_cookies;
+//CookieJar *_cookies;
 
 @synthesize console;
 
 - (instancetype) init {
     self = [super init];
     if (self) {
-        _cookies = [[CookieJar alloc] init];
+        // _cookies = [[CookieJar alloc] init];
     }
     return self;
 }
@@ -138,28 +138,28 @@ CookieJar *_cookies;
 }
 
 # pragma mark WebResourceLoadDelegate
-- (NSURLRequest *)webView:(WebView *)sender resource:(id)identifier
-          willSendRequest:(NSURLRequest *)request
-         redirectResponse:(NSURLResponse *)redirectResponse
-           fromDataSource:(WebDataSource *)dataSource {
-    // only handle cookies for http and https
-    if ([redirectResponse isKindOfClass:[NSHTTPURLResponse class]]) {
-        [_cookies handleCookiesInResponse:(NSHTTPURLResponse*) redirectResponse];
-    }
-
-    NSMutableURLRequest* modifiedRequest = [request mutableCopy];
-    [modifiedRequest setHTTPShouldHandleCookies:NO];
-    [_cookies handleCookiesInRequest:modifiedRequest];
-    return modifiedRequest;
-}
-
-- (void)   webView:(WebView *)sender resource:(id)identifier
-didReceiveResponse:(NSURLResponse *)response
-    fromDataSource:(WebDataSource *)dataSource {
-    if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
-        [_cookies handleCookiesInResponse: (NSHTTPURLResponse *) response];
-    }
-}
+//- (NSURLRequest *)webView:(WebView *)sender resource:(id)identifier
+//          willSendRequest:(NSURLRequest *)request
+//         redirectResponse:(NSURLResponse *)redirectResponse
+//           fromDataSource:(WebDataSource *)dataSource {
+//    // only handle cookies for http and https
+//    if ([redirectResponse isKindOfClass:[NSHTTPURLResponse class]]) {
+//        [_cookies handleCookiesInResponse:(NSHTTPURLResponse*) redirectResponse];
+//    }
+//
+//    NSMutableURLRequest* modifiedRequest = [request mutableCopy];
+//    [modifiedRequest setHTTPShouldHandleCookies:NO];
+//    [_cookies handleCookiesInRequest:modifiedRequest];
+//    return modifiedRequest;
+//}
+//
+//- (void)   webView:(WebView *)sender resource:(id)identifier
+//didReceiveResponse:(NSURLResponse *)response
+//    fromDataSource:(WebDataSource *)dataSource {
+//    if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
+//        [_cookies handleCookiesInResponse: (NSHTTPURLResponse *) response];
+//    }
+//}
 
 #pragma mark WebFrameLoadDelegate
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org