@@ -218,34 +218,29 @@ <h3 id="header">
218
218
< pre >
219
219
"Clear-Site-Data:" *< a > WSP</ a > < a > data-type-list</ a > *[ ";" *< a > WSP</ a > < a > extension</ a > *< a > WSP</ a > ] *< a > WSP</ a >
220
220
221
- < dfn > data-type-list</ dfn > = "*" / ( < a > data-type </ a > *( " " < a > data-type </ a > ) )
222
- < dfn > data-type </ dfn > = "cookie" / "dom" / "cache "
221
+ < dfn > data-type-list</ dfn > = "*" / ( < a > exclusion </ a > *( " " < a > exclusion </ a > ) )
222
+ < dfn > exclusion </ dfn > = "< dfn > retainCookies </ dfn > "
223
223
< dfn > extension</ dfn > = < a > subdomain-extension</ a > / < a > unknown-extension</ a >
224
- < dfn > subdomain-extension</ dfn > = "includeSubdomains"
224
+ < dfn > subdomain-extension</ dfn > = "< dfn > includeSubdomains</ dfn > "
225
225
< dfn > unknown-extension</ dfn > = *( < a > WSP</ a > / << a > VCHAR</ a > except ";" and ","> )
226
226
</ pre >
227
227
228
228
The header's value contains either the U+002A ASTERISK character
229
- (< code > *</ code > ) or a list of type keywords , followed by a set of options.
229
+ (< code > *</ code > ) or a list of type exclusions , followed by a set of options.
230
230
231
- The valid type keywords are:
231
+ If the header's value's < a > data-type-list</ a > component is "< code > *</ code > ",
232
+ then all data types specified in this document that are related to this site
233
+ will be removed.
232
234
233
- 1. < code > cookie</ code > , which implies that cookies for a host ought to be
234
- removed.
235
+ If exclusions are specified, then all data types specified in this document
236
+ will be removed, with the exception of the specified types. Recognized
237
+ exclusions are as follows:
235
238
236
- 2 . < code > dom </ code > , which implies that all DOM-accessible storage for an
237
- origin ought to be cleared .
239
+ 1 . < code > retainCookies </ code > , which implies that cookies for the site's
240
+ host will < code > not </ code > be removed .
238
241
239
- 3. < code > cache</ code > , which implies that all locally cached data for an
240
- origin ought to be cleared.
241
-
242
- ISSUE: This should probably be changed into a mechansim which excludes certain
243
- types. That is, I see a use case for skipping cookies. I don't see any for
244
- skipping DOM storage or Cache. Perhaps drop down to < code > *</ code > and
245
- < code > everything-but-cookies</ code > ?
246
-
247
- Invalid type keywords present in a header's value are simply ignored. Parsing
248
- details can be found in [[#parsing]].
242
+ Invalid exclusion keywords present in a header's value are simply ignored.
243
+ Parsing details can be found in [[#parsing]].
249
244
250
245
User agent conformance details are detailed in [[#clear]]. Those steps
251
246
represent the following requirements when the header is present in a
@@ -255,28 +250,30 @@ <h3 id="header">
255
250
delivered along with a Response whose URL is < a > < i lang ="la "> a priori</ i >
256
251
insecure</ a > .
257
252
258
- 2. If the value of the header contains "< code > *</ code > " or
259
- "< code > cookie</ code > ", then all cookies which would be sent along with
260
- requests to the < var > response</ var > 's {{Response/url}} MUST be removed.
253
+ Note: This means that the header will be ignored for unauthenticated or
254
+ unencrypted connections ("HTTP" vs "HTTPS", for example).
261
255
262
- If the < code > includeSubdomains</ code > option is present, then all cookies
263
- which would be sent along with requests to any host which is a subdomain
264
- of < var > response</ var > 's {{Response/url}}'s {{URL/host}} MUST be removed.
256
+ 2. If the value of the header's < a > data-type-list</ a > does not contain
257
+ < a > < code > retainCookies</ code > </ a > , then all cookies which would be sent
258
+ along with any request to the < var > response</ var > 's {{Response/url}}'s
259
+ {{URL/host}} MUST be removed.
260
+
261
+ Further, if the same header's < a > extension</ a > contains
262
+ < a > < code > includeSubdomains</ code > </ a > , then all cookies which would be
263
+ sent along with any request to any host which is a subdomain of
264
+ < var > response</ var > 's {{Response/url}}'s {{URL/host}} MUST be removed.
265
265
266
- 3. If the value of the header contains "< code > *</ code > " or
267
- "< code > dom</ code > ", then all DOM-accessible storage mechanisms
268
- ({{localStorage}}, {{sessionStorage}}, [[INDEXEDDB]], [[WEBDATABASE]],
269
- etc) for < var > response</ var > 's {{Response/url}}'s < a > origin</ a > MUST be
270
- cleared.
266
+ 3. All DOM-accessible storage mechanisms ({{localStorage}},
267
+ {{sessionStorage}}, [[INDEXEDDB]], [[WEBDATABASE]], etc) for
268
+ < var > response</ var > 's {{Response/url}}'s < a > origin</ a > MUST be cleared.
271
269
272
270
If the < code > includeSubdomains</ code > option is present, then all
273
271
DOM-accessible storage mechanisms for any < a > origin</ a > whose {{URL/host}}
274
272
is a subdomain of < var > response</ var > 's {{Response/url}}'s {{URL/host}}
275
273
MUST be cleared.
276
274
277
- 4. If the value of the header contains "< code > *</ code > " or
278
- "< code > cache</ code > ", then all locally cached data for
279
- < var > response</ var > 's {{Response/url}}'s {{URL/host}} MUST be removed.
275
+ 4. All locally cached data for < var > response</ var > 's {{Response/url}}'s
276
+ < a > origin</ a > MUST be removed.
280
277
281
278
If the < code > includeSubdomains</ code > option is present, then all locally
282
279
cached data for any host which is a subdomain of < var > response</ var > 's
@@ -295,21 +292,24 @@ <h3 id="fetch-integration">Fetch Integration</h3>
295
292
< a > < code > Clear-Site-Data</ code > </ a > , then execute [[#clear]] on
296
293
< var > response</ var > .
297
294
298
- Note: This happens < em > after</ em > < code > Set-Cookie</ code > headers are
299
- processed. If we clear cookies, we clear all of them.
295
+ Issue: This happens < em > after</ em > < code > Set-Cookie</ code > headers are
296
+ processed. If we clear cookies, we clear all of them. This is intentional,
297
+ and < a > < code > retainCookies</ code > </ a > is what we would offer to folks who
298
+ want to retain certain cookies. Perhaps we need a mechanism to allow only
299
+ certain cookies to be retained?
300
300
< section >
301
301
302
302
< section >
303
303
< h2 id ="algorithms "> Algorithms</ h2 >
304
304
305
305
< h3 id ="parsing "> Parsing</ h3 >
306
306
307
- < h4 id ="get-types ">
308
- Which data types ought to be cleared for < var > response</ var >
307
+ < h4 id ="get-exclusions ">
308
+ Which data types ought to be retained for < var > response</ var > ?
309
309
</ h4 >
310
310
311
311
TODO: Parse the < a > < code > Clear-Site-Data</ code > </ a > header. Return
312
- a list of type names.
312
+ a list of type names to be excluded .
313
313
314
314
< h4 id ="should-include-subdomains ">
315
315
Should subdomains' data be cleared for < var > response</ var >
@@ -336,22 +336,20 @@ <h3 id="clear">
336
336
< a > < code > Clear-Site-Data</ code > </ a > header to determine what needs to be
337
337
cleared, which origins are affected, and then executes those requests.
338
338
339
- 1. Let < var > types </ var > be the result of [[#get-types ]] executed on
339
+ 1. Let < var > exclusions </ var > be the result of [[#get-exclusions ]] executed on
340
340
< var > response</ var > .
341
341
342
342
2. Let < var > subdomains</ var > be the result of [[#should-include-subdomains]]
343
343
executed on < var > response</ var > .
344
344
345
- 3. If < var > types </ var > contains "< code > cookie </ code > ", execute
345
+ 3. If < var > exclusions </ var > does not contain "< code > cookies </ code > ", execute
346
346
[[#clear-cookies]] on < var > response</ var > 's {{Response/url}}'s
347
347
< a > origin</ a > , with < var > subdomains</ var > .
348
348
349
- 4. If < var > types</ var > contains "< code > dom</ code > ", execute [[#clear-dom]]
350
- on < var > response</ var > 's {{Response/url}}'s < a > origin</ a > , with
351
- < var > subdomains</ var > .
349
+ 4. Execute [[#clear-dom]] on < var > response</ var > 's {{Response/url}}'s
350
+ < a > origin</ a > , with < var > subdomains</ var > .
352
351
353
- 5. If < var > types</ var > contains "< code > cache</ code > ", execute
354
- [[#clear-cache]] on < var > response</ var > 's {{Response/url}}'s
352
+ 5. Execute [[#clear-cache]] on < var > response</ var > 's {{Response/url}}'s
355
353
< a > origin</ a > , with < var > subdomains</ var > .
356
354
357
355
< h4 id ="clear-cache ">
@@ -412,9 +410,15 @@ <h4 id="clear-cookies">
412
410
413
411
2. If < var > subdomain state</ var > is < a > < code > Include Subdomains</ code > </ a > ,
414
412
then let < var > cookie list</ var > be the set of cookies from the < a > cookie
415
- store</ a > whose < code > domain</ code > attribute < a > domain-matches </ a >
413
+ store</ a > whose < code > domain</ code > attribute is < a > domain-matched </ a > by
416
414
< var > host</ var > .
417
415
416
+ Note: The direction of the matching is important. If
417
+ < code > subdomain.example.com</ code > delivers the
418
+ < a > < code > Clear-Site-Data</ code > </ a > header and includes subdomains, then
419
+ cookies for < code > .another.subdomain.example.com</ code > will be cleared,
420
+ but cookies for < code > .example.com</ code > will not.
421
+
418
422
3. Otherwise, < var > subdomain state</ var > is < a > < code > Exclude
419
423
Subdomains</ code > </ a > , so let < var > cookie list</ var > be the set of
420
424
cookies from the < a > cookie store</ a > whose < code > domain</ code > attribute
0 commit comments