brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.57k stars 2.28k forks source link

"Keep local data only until you quit your browser" only deletes cookies, not local storage #1127

Open notDavid opened 6 years ago

notDavid commented 6 years ago

Description

Enabling "Keep local data only until you quit your browser" doesn't clear local storage.

Steps to Reproduce

  1. Enable "Content settings -> Cookies -> Keep local data only until you quit your browser"
  2. In settings, click "Clear browsing data" (time range: "All time", and check all boxes)
  3. Go to "Content settings -> Cookies -> See all cookies and site data" and confirm the list is empty
  4. Go to https://github.com/ (this will create cookies and "local storage")
  5. Restart Brave

Actual result:

"Content settings -> Cookies -> All cookies and site data" will not be fully cleared, it still contains "Local storage" items.

Expected result:

All local cache should be cleared

Reproduces how often:

Always

Brave version (chrome://version info)

Brave   0.55.3 Chromium: 70.0.3538.12 (Official Build) dev (64-bit)
Revision    ad61584ca32115f953ce656dd75b44f1c502a75d-refs/branch-heads/3538@{#179}
OS  Mac OS X  (10.13.6)

Reproducible on current release:

Website problems only:

Additional Information

notDavid commented 6 years ago

There are more type of items not being deleted on quit, the ones i have seen are: "Database storage", "Service workers" and "File System"

notDavid commented 5 years ago

Relevant thread: https://twitter.com/ctavan/status/1044282084020441088

So this issue seems to also exist in Google Chrome Version 69.0.3497.100 (Official Build) (64-bit) on macOS 10.13.6.

However, I tested and could not reproduce it, on macOS 10.14 (18A391), in Chromium: 71.0.3553.0 (Developer Build) (64-bit) 70.0.3538.0 (Developer Build) (64-bit) 69.0.3497.0 (Developer Build) (64-bit)

cndouglas commented 5 years ago

Related: #492

tneo commented 5 years ago

Relevant thread: https://twitter.com/ctavan/status/1044282084020441088

So this issue seems to also exist in Google Chrome Version 69.0.3497.100 (Official Build) (64-bit) on macOS 10.13.6.

However, I tested and could not reproduce it, on macOS 10.14 (18A391), in Chromium: 71.0.3553.0 (Developer Build) (64-bit) 70.0.3538.0 (Developer Build) (64-bit) 69.0.3497.0 (Developer Build) (64-bit)

For a browser (Brave) focusing on privacy and security, this seems to be top priority to overcome this issue. Now I have to rely on third-party extensions to make sure "clear all data upon exit" really does what it says.

tildelowengrimm commented 5 years ago

Maybe this'll be fixed if we enable the #rewrite-leveldb-on-deletion flag in Chromium? WDYT, @diracdeltas?

diracdeltas commented 5 years ago

Mentioned in #2249 (dupe): https://bugs.chromium.org/p/chromium/issues/detail?id=823071 is supposedly the Chromium issue causing this.

diracdeltas commented 5 years ago

using the original test plan, i was able to repro this intermittently.

1st try - all local storage cleared 2nd try - cookies cleared but not local storage. restarted again and local storage was cleared.

on master

diracdeltas commented 5 years ago

Unfortunately #rewrite-leveldb-on-deletion did not fully fix the issue

diracdeltas commented 5 years ago

Was able to repro this on Chrome 72 as well:

  1. enable setting to delete cookies when browser is closed
  2. Go to github.com, nytimes.com, google.com
  3. Restart
  4. Confirm localstorage/filesystem/cache entries are present in "Content settings -> Cookies -> See all cookies and site data"

Same thing happens with the rewrite-leveldb-on-deletion flag

Based on that I think https://bugs.chromium.org/p/chromium/issues/detail?id=823071 is the root cause of the issue in Brave

jumde commented 5 years ago

@diracdeltas @tomlowenthal - I'm able to repro this on Brave 0.66.101 Chromium: 75.0.3770.142 but not on Google Chrome 75.0.3770.142:

STR:

  1. Navigate to brave://settings/content/cookies, enable Keep local data only until you quit your browser
  2. Navigate to http://dustiest-limitation.000webhostapp.com/first_party.html, stores all data
  3. Navigate to http://dustiest-limitation.000webhostapp.com/view.html, you can view the data available for the site.
  4. Quit the browser
  5. Re-Open

Local Storage is available on Brave but not on Chrome.

Investigating!

leekocytes commented 4 years ago

Just piling on here - I am having this issue as well. I see this is on the Important Backlog (P2) project list - any update on this item? Love the work the brave team is doing!

Using: Version 1.0.1 Chromium: 78.0.3904.108 (Official Build) (64-bit)

uazo commented 4 years ago

it's just an idea, it would be possible to clean the data at startup, adding in ChromeActivity.finishNativeInitialization() something like

BrowsingDataBridge.getInstance().clearBrowsingData(
        new BrowsingDataBridge.OnClearBrowsingDataListener() {
        @Override
            public void onBrowsingDataCleared() {
            Context context = ContextUtils.getApplicationContext();
            Toast toast = Toast.makeText(context, "Data cleanup", Toast.LENGTH_SHORT);
            toast.show();
            }
        },
    new int[] {
        BrowsingDataType.HISTORY,
        BrowsingDataType.CACHE,
        BrowsingDataType.COOKIES,
        BrowsingDataType.PASSWORDS,
        BrowsingDataType.FORM_DATA,
        BrowsingDataType.SITE_SETTINGS
    }, TimePeriod.ALL_TIME);

in this way, we are sure that cookies and localStorage are deleted

snowbound commented 4 years ago

This problem may be related to this as well. Sorry to say I have removed Brave release and beta versions off my main computer and switched to another Chromium based browser. For the time being, I have Brave installed on a secondary machine here. I had so high hopes for Brave browser. Other than initial responses to my 2 month old post over at Brave community no responses from Brave personnel to my or another end user's repeated requests for updates re this issue.

tneo commented 4 years ago

You can overcome this issue by installing an extension. I use "Auto History Wipe" and that cleans out everything upon exiting Brave.

To which browser did you switch if I may ask?

Peacock365 commented 4 years ago

The Cookie AutoDelete extension can currently delete the local storage:

https://github.com/Cookie-AutoDelete/Cookie-AutoDelete

They cite Chromium 74 as the minimum requirement for this feature (clearing the local storage) to work, perhaps an API for this was introduced in this version. If you take a closer look at the GitHub commit history of the extension, I am sure you can find the patch where this what added, it wasn't too long ago. Wouldn't it be possible for you to just replicate this?

snowbound commented 4 years ago

MS Edge Chromium and Google Chrome when told to delete the "Google.com" cookie on exit of the browser does so. Next time you start up either of these browsers and go to gmail.com you have to login. With Brave if you do that you are still logged in to Gmail. Using extensions to delete cookies I have found takes the scorch earth approach resulting in the deletion of all cookies from google.com including the 2FA cookie that is set when you login and tell Gmail to trust this device for 30 days.

bsclifton commented 3 years ago

Following up on this - it seems that https://bugs.chromium.org/p/chromium/issues/detail?id=823071 was marked as fixed and closed October 2020

Are folks still having an issue with clearing local storage?

snowbound commented 3 years ago

I still have issues with Brave's inability to delete the "google.com" cookie as outlined here which I posted about a year ago on Brave Community posthttps://community.brave.com/t/google-com-cookies-not-being-cleared-on-exit/107692

As well I am unable to click on the garbage can to delete cookies for sites that allowed to save cookies. Issue is as described here