<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>171748</bug_id>
          
          <creation_ts>2017-05-05 14:10:28 -0700</creation_ts>
          <short_desc>[Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies</short_desc>
          <delta_ts>2017-05-05 16:45:09 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Blaze Burg">bburg</reporter>
          <assigned_to name="Blaze Burg">bburg</assigned_to>
          <cc>ap</cc>
    
    <cc>bburg</cc>
    
    <cc>beidson</cc>
    
    <cc>commit-queue</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1305301</commentid>
    <comment_count>0</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2017-05-05 14:10:28 -0700</bug_when>
    <thetext>I&apos;m going to temporarily make the assertion wrong so this can be investigated separately from the &quot;secure&quot; flag bug (https://bugs.webkit.org/show_bug.cgi?id=171700). The test fix for that exposed this unexpected failing test assertion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305310</commentid>
    <comment_count>1</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2017-05-05 14:15:57 -0700</bug_when>
    <thetext>Committed r216272: &lt;http://trac.webkit.org/changeset/216272&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305312</commentid>
    <comment_count>2</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2017-05-05 14:16:39 -0700</bug_when>
    <thetext>Un-closing, going to track the fix here too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305319</commentid>
    <comment_count>3</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2017-05-05 14:23:24 -0700</bug_when>
    <thetext>Looks like another round tripping issue:

(lldb) po cookie
&lt;NSHTTPCookie version:1 name:&quot;OtherCookieName&quot; value:&quot;OtherCookieValue&quot; expiresDate:(null) created:2017-05-05 21:18:10 +0000 sessionOnly:TRUE domain:&quot;.www.w3c.org&quot; partition:&quot;none&quot; path:&quot;/path&quot; isSecure:TRUE&gt;

(lldb) po cookie2.get()
&lt;NSHTTPCookie version:0 name:&quot;OtherCookieName&quot; value:&quot;OtherCookieValue&quot; expiresDate:2017-05-06 00:04:50 +0000 created:2017-05-05 21:18:10 +0000 sessionOnly:FALSE domain:&quot;.www.w3c.org&quot; partition:&quot;none&quot; path:&quot;/path&quot; isSecure:FALSE&gt;

Also note that the expires date is getting dropped, afaict. Is that something we are supposed to preserve?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305324</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-05-05 14:29:52 -0700</bug_when>
    <thetext>I think it&apos;s sessionOnly if it doesn&apos;t have an expiresDate... then the expiration date is when you close the browser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305331</commentid>
    <comment_count>5</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2017-05-05 14:40:23 -0700</bug_when>
    <thetext>The NS equivalent here is NSHTTPCookieDiscard:

https://developer.apple.com/reference/foundation/nshttpcookiediscard

&quot;String value must be either &quot;TRUE&quot; or &quot;FALSE&quot;. This cookie attribute is optional. The default is &quot;FALSE&quot;, unless this cookie is version 1 or greater and a value for NSHTTPCookieMaximumAge is not specified, in which case it is assumed to be &quot;TRUE&quot;.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305345</commentid>
    <comment_count>6</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2017-05-05 15:08:13 -0700</bug_when>
    <thetext>(In reply to Brian Burg from comment #5)
&gt; The NS equivalent here is NSHTTPCookieDiscard:
&gt; 
&gt; https://developer.apple.com/reference/foundation/nshttpcookiediscard
&gt; 
&gt; &quot;String value must be either &quot;TRUE&quot; or &quot;FALSE&quot;. This cookie attribute is
&gt; optional. The default is &quot;FALSE&quot;, unless this cookie is version 1 or greater
&gt; and a value for NSHTTPCookieMaximumAge is not specified, in which case it is
&gt; assumed to be &quot;TRUE&quot;.&quot;

Ignore the discard thing, I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305349</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2017-05-05 15:15:34 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #4)
&gt; I think it&apos;s sessionOnly if it doesn&apos;t have an expiresDate... then the
&gt; expiration date is when you close the browser.

Michael is right.

If it has an expires date, it&apos;s a persistent cookies.
If it doesn&apos;t, it&apos;s session.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305352</commentid>
    <comment_count>8</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2017-05-05 15:17:26 -0700</bug_when>
    <thetext>Yah, the test does the discard thing, but in reality having an expires date is what defines session or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305353</commentid>
    <comment_count>9</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2017-05-05 15:17:57 -0700</bug_when>
    <thetext>Except the docs say:
&quot;A boolean value that indicates whether the receiver should be discarded at the end of the session (regardless of expiration date).&quot;
lol wut.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305373</commentid>
    <comment_count>10</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-05-05 15:42:54 -0700</bug_when>
    <thetext>&lt;rdar://problem/32027327&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305388</commentid>
    <comment_count>11</comment_count>
      <attachid>309232</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2017-05-05 16:05:37 -0700</bug_when>
    <thetext>Created attachment 309232
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305414</commentid>
    <comment_count>12</comment_count>
      <attachid>309232</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-05-05 16:45:08 -0700</bug_when>
    <thetext>Comment on attachment 309232
Patch

Clearing flags on attachment: 309232

Committed r216292: &lt;http://trac.webkit.org/changeset/216292&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305415</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-05-05 16:45:09 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>309232</attachid>
            <date>2017-05-05 16:05:37 -0700</date>
            <delta_ts>2017-05-05 16:45:08 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-171748-20170505160536.patch</filename>
            <type>text/plain</type>
            <size>3963</size>
            <attacher name="Blaze Burg">bburg</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjE2MjcyCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggYjBhMzMyYTY5OGI1NjRk
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