<?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>200307</bug_id>
          
          <creation_ts>2019-07-31 10:10:12 -0700</creation_ts>
          <short_desc>SameSite Lax cookies aren&apos;t sent from tabs recovered from last Safari session when in scope of service workers</short_desc>
          <delta_ts>2019-08-02 13:32:30 -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>Service Workers</component>
          <version>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>200345</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rafael">xfalcox</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>cdumez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1557298</commentid>
    <comment_count>0</comment_count>
    <who name="Rafael">xfalcox</who>
    <bug_when>2019-07-31 10:10:12 -0700</bug_when>
    <thetext>Let there be a tab with a loaded web page which:

- contains a cookie with the SameSite bit set to &quot;Lax&quot;
- contains an active ServiceWorker proxying fetch requests

After killing the Safari app on iOS and reopening it, Safari will reload the tab.

During this reload the Lax cookie won&apos;t be sent in the requests to the server. If you refresh the page, even multiple times, the cookie will still not be sent.

If this cookie is a login cookie, the page will be show as if aren&apos;t logged in, resulting in a weird behavior for the user.

However, if you tap the address bar, make **no change** and tap go, navigating to the current page again, the cookie will be sent this time &quot;fixing&quot; the page.

I created a very simple and barebones demonstration of this bug:

- Bug reproduction website: https://rocky-fjord-97287.herokuapp.com/

- Source Code: https://github.com/xfalcox/safari-sw-samesite-bug

This bug affect the open source Forum software Discourse, and made me drop the offline browsing feature for Apple devices due to it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1558089</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-08-02 13:32:30 -0700</bug_when>
    <thetext>Looks like the same issue was filed separately a bit later, and that is already releted to a radar. Forward duping.

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

    </bug>

</bugzilla>