-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classify cookies as site storage #8
Comments
Perhaps
Also, if |
These are hairy issues but I'm sure we can tackle them to make devs' jobs easier. |
Script can detect HTTP cache entries through timing and can soon even tell through an API whether resources are cached. The UI for clearing cookies needs to clear both network and site storage, otherwise they can be revived. I guess I would be okay with putting cookies into the other bucket. I wonder what @sicking thinks. |
/ccing myself, as we should do sane things here wrt |
The big issue with cookies is that they aren't origin-scoped. That is,
|
I don't have an opinion about this. |
@davidsgrogan did you figure any of it out? I'm still a little hesitant to group cookies as they are clearly not origin-scoped and are much more a network-affair than what we cover thus far. |
Ah, so, just to chime in here: We determined that the only 'safe' way to keep or clear cookies is treat them on a 'registerable domain' scope. This means, basically, eTLD+1. So if you're keeping cookies for a site, you need to keep all cookies for that registerable domain, and if you want to clear, you have to clear all cookies for that registerable domain. Sites often do this kind of cookie usage/communication: plus.google.com -> google.com -> accounts.google.com. So clear accounts.google.com would kill all google sites (at the very least log you out). Websites don't expect this state to happen, so while google might make things technically still 'work' (or make it recoverable), other sites might be in a permanently broken state until all cookies are cleared. |
@dmurph right, so you'll put cookies in network storage then and not mix them with site storage? What about UI though? When the user clears storage, they probably expect cookies to go away too, no? Should the UI always clear on a registrable domain scope? |
Also, what does that mean for #4? |
Closing this as I still don't think we want to do this. |
Where did the "network storage" divide come from? I think of cookies as more like site storage since they are accessible to script. The http cache isn't AFAIK. Further, considering cookies as site storage gets us closer to the ideal of being able to pitch the "first-run" story to developers: if your origin gets purged due to quota pressure or
navigator.storage.purge()
you don't have to have any special logic to handle it, it will appear that the user has never visited your site before, so your first-run logic will suffice. Obviously, if we don't purge cookies then this story is a lie.@slightlyoff said it well in his original durable storage page:
Of course we can't guarantee that the user hasn't modified any data locally, e.g. they could have deleted the IDB directory from the browser's profile directory and left the cookies, but at that point the user is on their own.
The text was updated successfully, but these errors were encountered: