<?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>206811</bug_id>
          
          <creation_ts>2020-01-26 15:50:54 -0800</creation_ts>
          <short_desc>Same-origin type=&quot;module&quot; scripts only send cookies with crossorigin=&quot;use-credential&quot; set</short_desc>
          <delta_ts>2020-04-14 10:03:48 -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>Platform</component>
          <version>Safari 13</version>
          <rep_platform>All</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>210326</dup_id>
          
          <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>webkitbugzilla</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>beidson</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1611248</commentid>
    <comment_count>0</comment_count>
    <who name="">webkitbugzilla</who>
    <bug_when>2020-01-26 15:50:54 -0800</bug_when>
    <thetext>Safari seems to diverge from the other browsers (Chrome, Chromium Edge and Firefox) in how it treats the sending of cookies with requests with same-origin type=&quot;module&quot; script tags, and it seems to exist even if &quot;cross site tracking&quot; is deactivated. At first I thought it was CORS related, but because the script is being served from the same-origin I believe CORS wouldn&apos;t be required. The only way I was able to accomplish actually sending cookies on such a request was with passing `crossorigin=&quot;use-credentials&quot;`.

This does seem similar in nature to these outstanding bugs:
https://bugs.webkit.org/show_bug.cgi?id=171566
https://bugs.webkit.org/show_bug.cgi?id=171550

What&apos;s even stranger is that it _does_ seem to be fine with fetch(). I can successfully send a fetch() request for the same file in the console of the page (which should throw an error if the cookies were not included in the request).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1611250</commentid>
    <comment_count>1</comment_count>
    <who name="">webkitbugzilla</who>
    <bug_when>2020-01-26 16:16:11 -0800</bug_when>
    <thetext>I&apos;ve created a minimal example of this here.

https://positive-shallot.glitch.me

(Edit link here: https://glitch.com/edit/#!/positive-shallot)

You can see that the same-origin &quot;client.js&quot; script tag with type=&quot;module&quot; sends no request cookies, but does send them when the script requests the same file with a fetch(). Somewhat confusingly it requires the &quot;crossorigin&quot; tag to have the request send the same origin cookie (as shown with the &quot;client-use-credentials.js&quot; script).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1611826</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-01-27 22:50:03 -0800</bug_when>
    <thetext>&lt;rdar://problem/58946768&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1641430</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-04-14 10:03:48 -0700</bug_when>
    <thetext>Thanks for your report. WebKit was implemented based on old spec description (using &quot;omit&quot; by default), and the spec is now changed. This is fixed in bug 210326.

*** This bug has been marked as a duplicate of bug 210326 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>