user.js: Cookie clearing exceptions don't work after Arkenfox 102

🟥 https://github.com/arkenfox/user.js/wiki/5.2-Troubleshooting

  • I have read the troubleshooting guide, done the checks and confirmed this is caused by arkenfox
    • unchecked issues may will be closed as invalid

🟪 REQUIRED INFO

  • Browser version & OS: Firefox 102 on NixOS Unstable
  • Steps to Reproduce (STR):
    • Go to GitHub
    • Allow it to save cookies via the Ctrl+I menu
    • Log in
    • Restart Firefox
  • Expected result: You are still logged in
  • Actual result: You are no longer logged in
  • Console errors and warnings: none
  • Anything else you deem worth mentioning:
My overrides
// CONVINIENCE
// -----------------------------------------------
// Enable urlbar searching
user_pref("keyword.enabled", true); 
user_pref("browser.search.suggest.enabled", true);
user_pref("browser.urlbar.suggest.searches", true);
// Enable session restore
user_pref("browser.startup.page", 3);
// Remember the file download location
user_pref("browser.download.useDownloadDir", true);
// Don't clear history
user_pref("privacy.clearOnShutdown.history", false);
user_pref("privacy.cpd.history", false);
// Enable DRM
user_pref("media.eme.enabled", true);

// REMOVE USELESS FEATURES
// -----------------------------------------------
// Disable search engine suggestions in the urlbar
user_pref("browser.urlbar.suggest.engines", false);
// Disable container tabs
user_pref("privacy.userContext.enabled", false);
user_pref("privacy.userContext.ui.enabled", false);
// Don't save passwords
user_pref("signon.rememberSignons", false);

This worked as intended until the last version, but since v102 it no longer works.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 38 (16 by maintainers)

Most upvoted comments

This is #1507 - basically changes are

  • network.cookie.lifetimePolicy = 2
  • privacy.clearOnShutdown.cookies + privacy.clearOnShutdown.offlineApps = false

The reason it didn’t occur until 102 for AF users, is that we used the lifetimePolicy pref instead of clearing all cookies + offlineApps data on close. 102 then had a migration to reset lifetimePolicy etc, effectively making it useless, and we had to change. They have now backed that out in FF/ESR102.01

There are two issues going on here. One is the sanitize onStartup fallback (when sanitize onShutdown fails) doesn’t respect exceptions, this is fixed in 103. This means when Firefox doesn’t exit gracefully, e.g. exiting the app with the OS shutdown, or crashing, then everything gets wiped.

The second issue is this is still happening for users who do (presumably) exit gracefully - i.e not crashing, and are exiting nicely with processes etc. Something is either failing to respect exceptions onShutdown, or it is triggering a sanitize on startup.

In 103, we HAVE to move to using onShutdown (and ignoring lifetimePolicy) because that migration code is there in 103+, and all we would be doing is triggering the migration code every time we start the browser. I DO NOT KNOW if the issue will persist in 103 - it depends on the cause: some permission thing, some race condition, something else, IDFK.

But for 102, and since this is also used for ESR users, I am putting out a dot release to revert the behavior.

Yes, I’m on Windows.

I’ll try with a portable FF or with Sandbox. If I manage to reproduce it, I’ll open a bugzilla and link it here for you guys.

You can also flip both devtools.console.stdout.chrome and devtools.console.stdout.content to true - edit: for console data when it happens, may help, it’s supposed to with “crashes”, except no-one is crashing

open a bugzilla you guys, and report the console data

  • it will likely show that sanitize onshutdown never fired due to a permissions/security error

Worksforme (windows). I did have three instances where it did clear exceptions, but it seems stable now - it may be a case of not cleaning closing the app - I do use the quit button, but I did read a recent ticket about longer/munged shutdowns - IDK if that applies. Note: this non-clean shutdown sanitize issue is fixed in FF103

^ IDK if that is what is causing your issue. What app are you using - snap? flat? etc? How are you closing Firefox?

Otherwise, the only thing that sticks out is not clearing history, but that shouldn’t affect it. I have not tested.

Edit: PS: don’t play with the Privacy & Security>Cookies and Site Data>Delete cookies and site data when Firefox is closed checkbox, it will be unchecked and some people may keep checking that, which causes a “migration” which is not warranted. It will be fixed in future