X
Tap here to go to the mobile version of the site.
An updated version of Firefox is available to address the issues with Add-ons disabled or fail to install on Firefox. You can download the update for your OS here: https://www.mozilla.org/firefox/new/ For Known Issues and Workarounds, please check out the update at https://support.mozilla.org/kb/add-ons-disabled-or-fail-to-install-firefox

Support Forum

How to keep cookies for specific websites only?

Posted

I would like to save cookies for a few websites, while having all the others deleted after I close firefox. How do I set it up?

I would like to save cookies for a few websites, while having all the others deleted after I close firefox. How do I set it up?

Chosen solution

cor-el beat me to it!

The usual method is:

(1) Change the default cookie lifetime from "however long the website wants" to "current session only"

(2) Create exceptions on a site-by-site basis as needed

(3) Do not use any other method of clearing cookies, since the current session only cookies will be culled automatically

For #1:

  • Windows: "3-bar" menu button (or Tools menu) > Options
  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Linux: "3-bar" menu button (or Edit menu) > Preferences
  • Any system: type or paste about:preferences into the address bar and press Enter/Return to load it

In the left column, click Privacy & Security. On the right side, set "Firefox will: Use custom settings for history" and then:

[X] Accept cookies from websites Accept third-party cookies: Always Keep until: I close Firefox [_] Clear history when Firefox closes

For #2:

You can use the Exceptions button on the Options page, but the formatting can be particular. It may be easier to use the Permissions panel of the Page Info dialog while you're on the site that should be allowed to set cookies. You can call that up using either:

  • right-click a blank area of the page and choose View Page Info > Permissions
  • (menu bar) Tools menu > Page Info > Permissions

Scroll down to "Set Cookies" and uncheck the "Use default" box, and then select the permission you prefer (in this case, "Allow").

Changes are saved as you go, so you can close this dialog when you're finished.

For #3:

Make sure "Clear history when Firefox closes" is not checked. Or, if you want to clear cache or other data, click the Settings button to the right and make sure that neither Cookies nor Site Preferences is checked.

  • Cookies: does not obey exceptions, removes everything
  • Site Preferences: these are your exceptions, don't remove them

Does that work for you?

Read this answer in context 1

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17089 solutions 154352 answers

Let the cookies expire when Firefox is closed to make them session cookies instead of using "Clear history when Firefox closes" to clear the cookies.

  • Options/Preferences -> Privacy & Security -> "Use custom settings for history" -> Cookies: Keep until: "I close Firefox"

You can create an "Allow" exception to keep specific cookies.


In case you use "Clear history when Firefox closes" or otherwise clear history.

  • do not clear the Cookies
  • do not clear the Site Preferences
  • clearing "Site Preferences" clears exceptions for cookies, images, pop-up windows, and software installation and exception for password and other website specific data
  • clearing "Cookies" will remove all selected cookies including cookies with an "Allow" exception you may want to keep
Let the cookies expire when Firefox is closed to make them session cookies instead of using "Clear history when Firefox closes" to clear the cookies. *Options/Preferences -> Privacy & Security -> "Use custom settings for history" -> Cookies: Keep until: "I close Firefox" You can create an "Allow" exception to keep specific cookies. ---- In case you use "Clear history when Firefox closes" or otherwise clear history. *do not clear the Cookies *do not clear the Site Preferences *Options/Preferences -> Privacy & Security -> Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" -> Settings *https://support.mozilla.org/en-US/kb/delete-browsing-search-download-history-firefox *clearing "Site Preferences" clears exceptions for cookies, images, pop-up windows, and software installation and exception for password and other website specific data *clearing "Cookies" will remove all selected cookies including cookies with an "Allow" exception you may want to keep
jscher2000
  • Top 10 Contributor
8315 solutions 68040 answers

Chosen Solution

cor-el beat me to it!

The usual method is:

(1) Change the default cookie lifetime from "however long the website wants" to "current session only"

(2) Create exceptions on a site-by-site basis as needed

(3) Do not use any other method of clearing cookies, since the current session only cookies will be culled automatically

For #1:

  • Windows: "3-bar" menu button (or Tools menu) > Options
  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Linux: "3-bar" menu button (or Edit menu) > Preferences
  • Any system: type or paste about:preferences into the address bar and press Enter/Return to load it

In the left column, click Privacy & Security. On the right side, set "Firefox will: Use custom settings for history" and then:

[X] Accept cookies from websites Accept third-party cookies: Always Keep until: I close Firefox [_] Clear history when Firefox closes

For #2:

You can use the Exceptions button on the Options page, but the formatting can be particular. It may be easier to use the Permissions panel of the Page Info dialog while you're on the site that should be allowed to set cookies. You can call that up using either:

  • right-click a blank area of the page and choose View Page Info > Permissions
  • (menu bar) Tools menu > Page Info > Permissions

Scroll down to "Set Cookies" and uncheck the "Use default" box, and then select the permission you prefer (in this case, "Allow").

Changes are saved as you go, so you can close this dialog when you're finished.

For #3:

Make sure "Clear history when Firefox closes" is not checked. Or, if you want to clear cache or other data, click the Settings button to the right and make sure that neither Cookies nor Site Preferences is checked.

  • Cookies: does not obey exceptions, removes everything
  • Site Preferences: these are your exceptions, don't remove them

Does that work for you?

''cor-el beat me to it!'' The usual method is: (1) Change the default cookie lifetime from "however long the website wants" to "current session only" (2) Create exceptions on a site-by-site basis as needed (3) Do not use any other method of clearing cookies, since the current session only cookies will be culled automatically For #1: * Windows: "3-bar" menu button (or Tools menu) > Options * Mac: "3-bar" menu button (or Firefox menu) > Preferences * Linux: "3-bar" menu button (or Edit menu) > Preferences * Any system: type or paste '''about:preferences''' into the address bar and press Enter/Return to load it In the left column, click Privacy & Security. On the right side, set "Firefox will: Use custom settings for history" and then: [X] Accept cookies from websites Accept third-party cookies: Always '''Keep until: I close Firefox''' [_] Clear history when Firefox closes For #2: You can use the Exceptions button on the Options page, but the formatting can be particular. It may be easier to use the Permissions panel of the Page Info dialog while you're on the site that should be allowed to set cookies. You can call that up using either: * right-click a blank area of the page and choose View Page Info > Permissions * (menu bar) Tools menu > Page Info > Permissions Scroll down to "Set Cookies" and uncheck the "Use default" box, and then select the permission you prefer (in this case, "Allow"). Changes are saved as you go, so you can close this dialog when you're finished. For #3: Make sure "Clear history when Firefox closes" is not checked. Or, if you want to clear cache or other data, click the Settings button to the right and make sure that neither Cookies nor Site Preferences is checked. * Cookies: does not obey exceptions, removes everything * Site Preferences: these are your exceptions, don't remove them Does that work for you?

Modified by jscher2000