Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox deletes ALL cookies upon closing, but I have allow cookies for some sites. How can I save JUST the cookies for allowed sites?

  • 5 replies
  • 2 have this problem
  • 1 view
  • Last reply by sushi4

more options

Firefox deletes ALL cookies upon closing, but I have allow cookies for some sites. How can I save JUST the cookies for allowed sites? This used to work in Firefox.

Firefox deletes ALL cookies upon closing, but I have allow cookies for some sites. How can I save JUST the cookies for allowed sites? This used to work in Firefox.

Chosen solution

The Preferences page has been rearranged, so there are at least two relevant sections.

Default All Cookies to Session-only

The setting to dump cookies automatically at the end of your regular session is now here:

  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Windows: "3-bar" menu button (or Tools menu) > Options
  • 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, and on the right side, scroll down to the Cookies and Site Data section.

The checkbox for "Delete cookies and site data when Firefox is closed" works as follows:

(A) If the box is NOT checked, then Firefox lets sites specify how long Firefox will retain their cookies. (Like the old "Keep until: they expire")

(B) If the box IS checked, then Firefox shortens the site's preferred expiration time to the end of the current session. (Like the old "Keep until: Firefox is closed") You can let sites store persistent cookies by creating an exception using the Manage Permissions button. Format note, include the protocol, for example:

Exceptions are only needed if you want to stay logged in to a site.

Turn off or Adjust the Clear History Feature

Firefox also can delete all cookies -- disregarding exceptions -- using the feature to Clear history when Firefox closes. If you want to keep some cookies, do not use this feature.

To check on this, scroll down to the History section

Select:

"Firefox will: Use custom settings for history"

If you have a check mark for "Clear history when Firefox closes" then either:

  • Uncheck this option to preserve your cookies and other history
  • Click the Settings button to the right of this line and uncheck the box for Cookies

Can you get it to work the way you want?

Read this answer in context 👍 1

All Replies (5)

more options

Chosen Solution

The Preferences page has been rearranged, so there are at least two relevant sections.

Default All Cookies to Session-only

The setting to dump cookies automatically at the end of your regular session is now here:

  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Windows: "3-bar" menu button (or Tools menu) > Options
  • 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, and on the right side, scroll down to the Cookies and Site Data section.

The checkbox for "Delete cookies and site data when Firefox is closed" works as follows:

(A) If the box is NOT checked, then Firefox lets sites specify how long Firefox will retain their cookies. (Like the old "Keep until: they expire")

(B) If the box IS checked, then Firefox shortens the site's preferred expiration time to the end of the current session. (Like the old "Keep until: Firefox is closed") You can let sites store persistent cookies by creating an exception using the Manage Permissions button. Format note, include the protocol, for example:

Exceptions are only needed if you want to stay logged in to a site.

Turn off or Adjust the Clear History Feature

Firefox also can delete all cookies -- disregarding exceptions -- using the feature to Clear history when Firefox closes. If you want to keep some cookies, do not use this feature.

To check on this, scroll down to the History section

Select:

"Firefox will: Use custom settings for history"

If you have a check mark for "Clear history when Firefox closes" then either:

  • Uncheck this option to preserve your cookies and other history
  • Click the Settings button to the right of this line and uncheck the box for Cookies

Can you get it to work the way you want?

more options

jscher2000 said

The Preferences page has been rearranged, so there are at least two relevant sections. Default All Cookies to Session-only The setting to dump cookies automatically at the end of your regular session is now here:
  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Windows: "3-bar" menu button (or Tools menu) > Options
  • 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, and on the right side, scroll down to the Cookies and Site Data section. The checkbox for "Delete cookies and site data when Firefox is closed" works as follows: (A) If the box is NOT checked, then Firefox lets sites specify how long Firefox will retain their cookies. (Like the old "Keep until: they expire") (B) If the box IS checked, then Firefox shortens the site's preferred expiration time to the end of the current session. (Like the old "Keep until: Firefox is closed") You can let sites store persistent cookies by creating an exception using the Manage Permissions button. Format note, include the protocol, for example: Exceptions are only needed if you want to stay logged in to a site. Turn off or Adjust the Clear History Feature Firefox also can delete all cookies -- disregarding exceptions -- using the feature to Clear history when Firefox closes. If you want to keep some cookies, do not use this feature. To check on this, scroll down to the History section Select: "Firefox will: Use custom settings for history" If you have a check mark for "Clear history when Firefox closes" then either:
  • Uncheck this option to preserve your cookies and other history
  • Click the Settings button to the right of this line and uncheck the box for Cookies
Can you get it to work the way you want?

I suggest also to uncheck "Site preference" in "Clear history when Firefox closes">Settings, so your exceptions for allowed sites are not cleared when Firefox closes.

more options

I want to automatically clear history when Firefox closes, except for one domain which is now set up to allow access by only my PC (unrecognized computer restriction), for which the site needs to see its cookies on my PC from the previous session. Do I correctly understand that listing this domain in Manage Permissions will accomplish exactly that? Also, the recommended response above states "Exceptions are only needed if you want to stay logged in to a site". For my purposes, do I need to put the same domain name (I know about http: with and without the 's') under Exceptions, if my only goal is to be able to have my computer recognized by that site when I next log in, having cleared cookies upon logging out the last time? This site web support has stated to me several times that it all comes down to their being able to cookies from the previous session, but so far I have trouble getting my PC recognized, despite using Manager Permissions.

more options

Quenchoo said

I want to automatically clear history when Firefox closes, except for one domain which is now set up to allow access by only my PC (unrecognized computer restriction), for which the site needs to see its cookies on my PC from the previous session. Do I correctly understand that listing this domain in Manage Permissions will accomplish exactly that?

Three things:

(1) Create one or more "Allow" exceptions in Manage Permissions

(2) Check the box for "Delete cookies and site data when Firefox is closed"

(3) UNCHECK the box for Cookies under "Clear history when Firefox closes" > "Settings" (this feature will blow away all cookies whether you made an exception or not)

more options

jscher2000 said

Quenchoo said
I want to automatically clear history when Firefox closes, except for one domain which is now set up to allow access by only my PC (unrecognized computer restriction), for which the site needs to see its cookies on my PC from the previous session. Do I correctly understand that listing this domain in Manage Permissions will accomplish exactly that?

Three things:

(1) Create one or more "Allow" exceptions in Manage Permissions

(2) Check the box for "Delete cookies and site data when Firefox is closed"

(3) UNCHECK the box for Cookies under "Clear history when Firefox closes" > "Settings" (this feature will blow away all cookies whether you made an exception or not)

Some websites use cookies in several (sub-)domains to store user session. In my experience, Gmail requires allow cookies for google.com, accounts.google.com, and mail.google.com so I can stay logged in after Firefox restarts.

I suggest, after you're logged in, to check for which (sub-)domains your cookies are stored. To do so :

  • Click the button "Manage Data..." under "Cookies and Site Data" section in the preferences.

So you could allow relevant (sub-)domains (one by one, until you get the desired outcome) into the exceptions list in "Manage Permissions...".

FYI, you could you an extension, such as Cookie AutoDelete, to ease the process of whitelisting cookies for relevant (sub-)domains of a current page you're on.

Modified by sushi4