Bug 272388 - iFrame constantly refreshing after getting storage access in Private Browsing
Summary: iFrame constantly refreshing after getting storage access in Private Browsing
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: Safari 17
Hardware: Unspecified macOS 14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-04-09 05:19 PDT by Samet
Modified: 2024-04-27 06:08 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samet 2024-04-09 05:19:00 PDT
I have a website, www.siteA.com (any website), that contains iframe www.siteB.com (my PHP app). Using Safari Private Browsing, when I go to www.siteA.com and start loading www.siteB.com in the iframe, I start a flow to ask for access to third-party cookies by clicking on a button that opens www.siteB.com in a popup as a first party in which I click on a another button that closes the popup. Afterwards in the iframe I click on a button that requests access to third-party cookies using document.requestStorageAccess(). Once I allow www.siteB.com to use cookies and website data, the iframe will load www.siteB.com and will set a cookie that I use to know that the user already went through the flow I just explained and skip it on a refresh. 

All of this works as expected when loading it for the first time. When I update the src of the iframe because I want to load a different page in www.siteB.com or simply refresh www.siteA.com, the iframe will make me go through the previously described flow again and load the iframe properly. After that, if I refresh www.siteA.com or I update the src of the iframe again, I will get stuck in a loop constantly refreshing the iframe for some reason. Refreshing doesn't fix this either, somehow this breaks the iframe until I close Safari and open it again in Private Browsing or close and reopen the tab, restarting the whole cycle. 

Nothing else besides the creation of the cookie is happening in the PHP app that could be influencing this. The flow is written in JavaScript running within a script HTML element. 

This issue does not happen when Private Browsing is disabled.
Comment 1 Alexey Proskuryakov 2024-04-09 11:47:28 PDT
Thank you for the report. This seems unlikely to be actionable without a test case that we can use to reproduce.
Comment 2 Radar WebKit Bug Importer 2024-04-16 05:19:13 PDT
<rdar://problem/126546998>
Comment 3 Ahmad Saleem 2024-04-18 07:41:28 PDT
@Samet - can you share test website to help us reproduce?