Changeset 216292 in webkit


Ignore:
Timestamp:
May 5, 2017 4:45:05 PM (7 years ago)
Author:
BJ Burg
Message:

[Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies
https://bugs.webkit.org/show_bug.cgi?id=171748
<rdar://problem/32027327>

Reviewed by Michael Catanzaro.

Source/WebCore:

The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
also misusing the NSHTTPCookieDiscard property. If any value is provided for
this key, even @NO, CFNetwork interprets that to mean that the cookie has the
"session" flag.

This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore,
and WebAutomationSession.

This is covered by existing test WebKit2.WKHTTPCookieStore.

  • platform/network/cocoa/CookieCocoa.mm:

(WebCore::Cookie::operator NSHTTPCookie *):
Don't include the property if the cookie is not a session cookie.

Tools:

Remove temporary workaround now that the assertion failure is fixed.

  • TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:

(TEST):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r216285 r216292  
     12017-05-05  Brian Burg  <bburg@apple.com>
     2
     3        [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies
     4        https://bugs.webkit.org/show_bug.cgi?id=171748
     5        <rdar://problem/32027327>
     6
     7        Reviewed by Michael Catanzaro.
     8
     9        The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
     10        also misusing the NSHTTPCookieDiscard property. If any value is provided for
     11        this key, even @NO, CFNetwork interprets that to mean that the cookie has the
     12        "session" flag.
     13
     14        This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore,
     15        and WebAutomationSession.
     16
     17        This is covered by existing test WebKit2.WKHTTPCookieStore.
     18
     19        * platform/network/cocoa/CookieCocoa.mm:
     20        (WebCore::Cookie::operator NSHTTPCookie *):
     21        Don't include the property if the cookie is not a session cookie.
     22
    1232017-05-05  Youenn Fablet  <youenn@apple.com>
    224
  • trunk/Source/WebCore/platform/network/cocoa/CookieCocoa.mm

    r216258 r216292  
    9999        [properties setObject:@YES forKey:NSHTTPCookieSecure];
    100100
    101     [properties setObject:(session ? @"TRUE" : @"FALSE") forKey:NSHTTPCookieDiscard];
     101    if (session)
     102        [properties setObject:@YES forKey:NSHTTPCookieDiscard];
     103
    102104    [properties setObject:@"1" forKey:NSHTTPCookieVersion];
    103105
  • trunk/Tools/ChangeLog

    r216291 r216292  
     12017-05-05  Brian Burg  <bburg@apple.com>
     2
     3        [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies
     4        https://bugs.webkit.org/show_bug.cgi?id=171748
     5        <rdar://problem/32027327>
     6
     7        Reviewed by Michael Catanzaro.
     8
     9        Remove temporary workaround now that the assertion failure is fixed.
     10
     11        * TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
     12        (TEST):
     13
    1142017-05-05  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm

    r216272 r216292  
    132132            ASSERT_TRUE([cookie2.get().domain isEqualToString:cookie.domain]);
    133133            ASSERT_FALSE(cookie.secure);
    134             // FIXME: this should be ASSERT_FALSE. Investigating in <https://bugs.webkit.org/show_bug.cgi?id=171748>.
    135             ASSERT_TRUE(cookie.sessionOnly);
     134            ASSERT_FALSE(cookie.sessionOnly);
    136135        }
    137136    }
Note: See TracChangeset for help on using the changeset viewer.