Bug 185534 - Storage Access API: Extend lifetime of cookies on successful user approval
Summary: Storage Access API: Extend lifetime of cookies on successful user approval
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Wilander
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-10 16:35 PDT by John Wilander
Modified: 2018-05-10 18:59 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.36 KB, patch)
2018-05-10 16:38 PDT, John Wilander
no flags Details | Formatted Diff | Diff
Patch for landing (4.50 KB, patch)
2018-05-10 18:21 PDT, John Wilander
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Wilander 2018-05-10 16:35:49 PDT
Experimental Storage Access API prompting is added in https://bugs.webkit.org/show_bug.cgi?id=185335. We should consider explicit user opt-in equivalent to user interaction as first party and thus extend the life time of cookies and website data.
Comment 1 John Wilander 2018-05-10 16:36:16 PDT
<rdar://problem/40064547>
Comment 2 John Wilander 2018-05-10 16:38:49 PDT
Created attachment 340146 [details]
Patch
Comment 3 Brent Fulgham 2018-05-10 16:55:51 PDT
Comment on attachment 340146 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=340146&action=review

> Source/WebKit/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=185534

<rdar://problem/40064547>

> Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:466
> +    if (userWasPromptedNowOrEarlier && m_storageAccessPromptsEnabled) {

Is it possible to have "userWasPromptedNowEarlier" be true, but 'm_storageAccessPromptsEnabled' is false? It doesn't seem like this code needs to know the state of the prompts being enabled -- if we get an update that says the prompt was accepted, we can just extend the lifetime of the cookie.
Comment 4 Brent Fulgham 2018-05-10 17:14:02 PDT
Comment on attachment 340146 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=340146&action=review

>> Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:466
>> +    if (userWasPromptedNowOrEarlier && m_storageAccessPromptsEnabled) {
> 
> Is it possible to have "userWasPromptedNowEarlier" be true, but 'm_storageAccessPromptsEnabled' is false? It doesn't seem like this code needs to know the state of the prompts being enabled -- if we get an update that says the prompt was accepted, we can just extend the lifetime of the cookie.

Oh I get it. The tests won't work properly if we don't check for the experimental feature. Can you just add a FIXME here to remove this code once if we decide to use prompting for Storage Access API?
Comment 5 Brent Fulgham 2018-05-10 17:14:47 PDT
Comment on attachment 340146 [details]
Patch

r=me if EWS passes, and if you add the FIXME (with radar/bugzilla)
Comment 6 John Wilander 2018-05-10 18:21:41 PDT
Created attachment 340154 [details]
Patch for landing
Comment 7 John Wilander 2018-05-10 18:24:46 PDT
Thanks, Brent!
Comment 8 WebKit Commit Bot 2018-05-10 18:59:30 PDT
Comment on attachment 340154 [details]
Patch for landing

Clearing flags on attachment: 340154

Committed r231684: <https://trac.webkit.org/changeset/231684>
Comment 9 WebKit Commit Bot 2018-05-10 18:59:31 PDT
All reviewed patches have been landed.  Closing bug.