<?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>137745</bug_id>
          
          <creation_ts>2014-10-15 11:32:09 -0700</creation_ts>
          <short_desc>When in private mode, cookies in iFramed content are not set correctly</short_desc>
          <delta_ts>2014-11-03 12:17:55 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Frames</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.9</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://run.plnkr.co/my0lgusP2UEYNTbL/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>natenate</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>mhock</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1041906</commentid>
    <comment_count>0</comment_count>
    <who name="">natenate</who>
    <bug_when>2014-10-15 11:32:09 -0700</bug_when>
    <thetext>I found this in Safari 7.1 and Webkit Nightly:

Steps to repro:
1. Start or restart Webkit
2. Put Webkit into Private Browsing mode
3. Browse to http://run.plnkr.co/my0lgusP2UEYNTbL/
4. Expect the text &apos;Cookie value is: CSRF-Token=is_this_set%3F&apos; to be visible
5. !! Only see &apos;Cookie value is: &apos;. 

Summary:
The site loads a page, which includes iframed content. The iframed content should have access to a cookie value that is returned by the server (visible in headers) but is not available via Javascript.

Some interesting other observations:
* Sometimes this seems to happen in regular browsing mode, as well as private browsing
* If you right click the iframe, and select &quot;Open Frame in New Tab&quot;, the page will load and render the correct value. Bizarrely, if you then go back to http://run.plnkr.co/my0lgusP2UEYNTbL/ and refresh the page, the iframe will load with the correct value!
* If the host is the same in the iframe and the parent frame, the issue is not reproducible: http://safe-everglades-1254.herokuapp.com/iframed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1042095</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-10-16 00:19:34 -0700</bug_when>
    <thetext>Martin, sounds like cookie accept policy may be incorrect in private browsing mode?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1042170</commentid>
    <comment_count>2</comment_count>
    <who name="">natenate</who>
    <bug_when>2014-10-16 13:37:28 -0700</bug_when>
    <thetext>It looks like my plnkr.co link died. I&apos;ll try to find a permalink.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1042172</commentid>
    <comment_count>3</comment_count>
    <who name="">natenate</who>
    <bug_when>2014-10-16 13:40:06 -0700</bug_when>
    <thetext>http://run.plnkr.co/plunks/b3IFwWieUdiMrjSk3CLW/ should work. Apologies for that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045178</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-10-30 17:06:36 -0700</bug_when>
    <thetext>What is your cookie accept policy in Safari? With the default policy, a cross-origin subframe is not allowed to store cookies.

I suspect that you have a non-default policy set in Safari preferences, and that using private browsing reverts that to default. If so, Safari/WebKit behavior seems incorrect, but I&apos;d like to confirm that this is indeed what you are seeing.

&gt; * If you right click the iframe, and select &quot;Open Frame in New Tab&quot;, the page will load and render the correct value. Bizarrely, if you then go back to http://run.plnkr.co/my0lgusP2UEYNTbL/ and refresh the page, the iframe will load with the correct value!

Yes, this is expected for the default cookie policy - cross-origin subframes may not store cookies, but they can read existing ones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045183</commentid>
    <comment_count>5</comment_count>
    <who name="">natenate</who>
    <bug_when>2014-10-30 17:18:45 -0700</bug_when>
    <thetext>I never changed my cookie policy. This only happens when I&apos;m browsing in private browsing mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045227</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-10-30 22:38:32 -0700</bug_when>
    <thetext>So, what is your cookie accept policy?

You say that this only happens in private browsing mode for you, however I can reproduce perfectly well in non-private mode too. Please delete all cookies for safe-everglades-1254.herokuapp.com before re-testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045264</commentid>
    <comment_count>7</comment_count>
    <who name="">natenate</who>
    <bug_when>2014-10-31 05:41:47 -0700</bug_when>
    <thetext>Is there a programmatic way to access the cookie policy, or do you just need to know what my settings are under the privacy tab for cookies? Happy to provide whatever information I can.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045291</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-10-31 10:19:55 -0700</bug_when>
    <thetext>&gt; do you just need to know what my settings are under the privacy tab for cookies

Yes, this is what I was asking about.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045810</commentid>
    <comment_count>9</comment_count>
    <who name="">natenate</who>
    <bug_when>2014-11-03 11:47:13 -0800</bug_when>
    <thetext>Ok, thanks Alexey. You&apos;re right, this is also happening when not in Private mode. Here&apos;s a screenshot of the settings I have in Safari 8, that also replicates the issue:http://imgur.com/ZJl8vht

Thanks again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045820</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-11-03 12:17:55 -0800</bug_when>
    <thetext>Thank you very much for following up so promptly. Yes, this is the default cookie accept policy, which allows accepting cookies from the main frame, and also from subframes that already have some cookies associated with their domain.

Closing as INVALID, as this is behaving as expected.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>