Hi Andrea, others, I am mostly ignorant of these matters, so please correct me when I'm wrong.
On Wed, Jan 23, 2019 at 5:24 AM Andrea Marchesini <amarches...@mozilla.com> wrote: > Hi all, > > When the cookie policy or a cookie permission changes, firefox applies the > new behavior to any existing documents immediately. I would like to change > this, applying the new behavior to new documents only. > <snip introduction> > The reasons why I think we should not apply the new behavior to > live-documents are this: > > *websites can break* > If we go from BEHAVIOR_ACCEPT to BEHAVIOR_REJECT (or ACCEPT_DENY), all the > storage APIs will start throwing exceptions (or reject promises). This is > an unpredictable behavior which can break the website's logic and makes the > storage APIs inconsistent. Note that this is different than blocking > cookies since the document loading. > Plus it doesn't give any extra security/privacy benefit: the website could > have already copied cookie data into local variables and it can still send > this data to the server. > If we go from BEHAVIOR_REJECT to BEHAVIOR_ACCEPT (or ACCEPT_ALLOW), > basically no website can "recover" itself without a reloading. > <snip complexity and performance> > subdocument content, stores the cookie behavior (permission + policy) for > its principal at creation time. The policy is applied to the whole > document's cookie jar and it doesn't change. > For BEHAVIOR_REJECT_TRACKER, when the storage access is granted (see > AccessStorage API and the anti-tracking heuristics), we recalculate the > document's cookie policy. > > When the cookie policy or a cookie permission is changed, we inform the > user that the current tabs must be reloaded in order to apply the new > settings. > You pointed out one case of unpredictable behaviour: a website's logic cannot preserve assumptions across the entire duration of it's JS execution context. But if we don't apply the policy instantly, isn't the reverse situation also possible? When the browser tells me to reload a tab I generally open a new tab and navigate back -- who knows what state I wanted that would be lost. Now suppose I do that and have the same origin in two tabs. In your situation the two tabs can have different policies for their JS execution lifetimes, correct? And some of these "cookie" mechanisms -- particularly localStorage -- are used for communicating between tabs, IIUC. I am not sure if cookies themselves matter between tabs, but perhaps they do. Now my two tabs might see subtly different data for the same origin. Is this an issue in theory? Will it be an issue in the wild? I'm totally willing to hear that I don't understand our document/origin/something else model. Thanks! Nick _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform