Closed Bug 1260360 Opened 8 years ago Closed 8 years ago

Session Restore needs to honor "Clear history when Firefox closes -> Cookies" in a clean shut-down

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 48
Tracking Status
firefox48 --- fixed

People

(Reporter: ke5trel, Assigned: ke5trel)

References

Details

(Keywords: privacy)

Attachments

(1 file, 1 obsolete file)

Simple addition to Bug 529899 to include the case where the user has the preference "Clear history when Firefox closes -> Cookies" so that session cookies are cleared in a clean shutdown.
Depends on: 529899
Keywords: privacy
(Will need help with a try push if that is necessary)
Attachment #8735731 - Flags: review?(dteller)
Comment on attachment 8735731 [details] [diff] [review]
bug1260360.patch - Purge cookies on clean shutdown with "Clear history when Firefox closes -> Cookies"

Mike is in charge of this, so deferring.
Attachment #8735731 - Flags: review?(dteller) → review?(mconley)
Comment on attachment 8735731 [details] [diff] [review]
bug1260360.patch - Purge cookies on clean shutdown with "Clear history when Firefox closes -> Cookies"

Review of attachment 8735731 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch, Kestrel!

::: browser/components/sessionstore/SessionSaver.jsm
@@ +211,5 @@
>        }
>      }
>  
>      // If this is the final write on a clean shutdown, and the user changed
> +    // their cookie preferences to "Keep until I close Firefox" or 

There's some trailing whitespace that should be removed in this patch.

@@ +218,2 @@
>      // cookies when restarting due to a Firefox update.
>      if (RunState.isClosing &&

It's a little difficult to read the logic in here at first glance. To help, what I'd suggest is this:

if (RunState.isClosing) {
  let sessionCookiesOnly = Services.prefs.getIntPref("network.cookie.lifetimePolicy") == Services.cookies.ACCEPT_SESSION;
  let sanitizeCookies = Services.prefs.getBoolPref("privacy.sanitize.sanitizeOnShutdown") &&
                        Services.prefs.getBoolPref("privacy.clearOnShutdown.cookies");
  let willResume = Services.prefs.getBoolPref("browser.sessionstore.resume_session_once");

  if ((sessionCookiesOnly || sanitizeCookies) && !willResume) {
    // Do the deletion
  }
}
Attachment #8735731 - Flags: review?(mconley) → review-
Good idea, the comment description can also be trimmed down this way.
Attachment #8735731 - Attachment is obsolete: true
Attachment #8738063 - Flags: review?(mconley)
Comment on attachment 8738063 [details] [diff] [review]
bug1260360.patch v2 - Purge cookies on clean shutdown according to sanitize preference

Review of attachment 8738063 [details] [diff] [review]:
-----------------------------------------------------------------

Patch and try looks good! Thanks!
Attachment #8738063 - Flags: review?(mconley) → review+
https://hg.mozilla.org/mozilla-central/rev/4209cc859abc
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Blocks: 1315524
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: