为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

No way to save specific cookies on firefox exit?

  • 7 个回答
  • 13 人有此问题
  • 1 次查看
  • 最后回复者为 cor-el

more options

I want to have Firefox delete all cookies upon exiting, except for those from specific domains that I designate. Even though I would think this would be a pretty obvious setting to have, I cannot find anyway to do this.

As near as I can tell, the only two options I have within the Firefox privacy settings are to either have all cookies deleted on exit, or none of them. Is there truly no middle ground? Here are my current Firefox settings; if someone could tell me what I need to adjust to get the desired result, I would greatly appreciate it:

Use custom settings for history Always use private browsing mode - unchecked Remember my browsing and download history - checked Remember search and form history - checked

Accept cookies from sites - checked Accept third-party cookies - unchecked Keep until: I close Firefox Clear history when Firefox closes - checked

The 'Exceptions' submenu has several domains set to "Allow" - these are the cookies I would like Firefox to keep on exit.

Settings for clearing History - In this submenu, 'Cookies' is unchecked. While this is unchecked, Firefox will not delete any cookies on exit, even though I have the 'Keep until I close Firefox" option enabled. But if I check this box, Firefox deletes all cookies on exit and ignores my Allowed Exceptions. This seeems to make no sense to me.

I want to have Firefox delete all cookies upon exiting, except for those from specific domains that I designate. Even though I would think this would be a pretty obvious setting to have, I cannot find anyway to do this. As near as I can tell, the only two options I have within the Firefox privacy settings are to either have all cookies deleted on exit, or none of them. Is there truly no middle ground? Here are my current Firefox settings; if someone could tell me what I need to adjust to get the desired result, I would greatly appreciate it: Use custom settings for history Always use private browsing mode - unchecked Remember my browsing and download history - checked Remember search and form history - checked Accept cookies from sites - checked Accept third-party cookies - unchecked Keep until: I close Firefox Clear history when Firefox closes - checked The 'Exceptions' submenu has several domains set to "Allow" - these are the cookies I would like Firefox to keep on exit. Settings for clearing History - In this submenu, 'Cookies' is unchecked. While this is unchecked, Firefox will not delete any cookies on exit, even though I have the 'Keep until I close Firefox" option enabled. But if I check this box, Firefox deletes all cookies on exit and ignores my Allowed Exceptions. This seeems to make no sense to me.

被采纳的解决方案

所有回复 (7)

more options

Here are my privacy settings again. My formatting in the original question did not hold:

Use custom settings for history

Always use private browsing mode - unchecked

Remember my browsing and download history - checked

Remember search and form history - checked

Accept cookies from sites - checked

Accept third-party cookies - unchecked

Keep until: I close Firefox

Clear history when Firefox closes - checked

The 'Exceptions' submenu has several domains set to "Allow" - these are the cookies I would like Firefox to keep on exit.

Settings for clearing History - In this submenu, 'Cookies' is unchecked. While this is unchecked, Firefox will not delete any cookies on exit, even though I have the 'Keep until I close Firefox" option enabled. But if I check this box, Firefox deletes all cookies on exit and ignores my Allowed Exceptions. This seeems to make no sense to me.

由flang于修改

more options

选择的解决方案

more options

Thank you for your help. I think the issue is resolved. I believe I was confused as to which cookies were being saved, and which were not.

more options

Let all cookies expire when you close Firefox.

  • Firefox/Tools > Options > Privacy > Cookies: Keep until: I close Firefox

Create an Allow exception for cookies that you want to keep.

  • Firefox/Tools > Options > Privacy > Cookies: Exceptions

In case you are using "Clear history when Firefox closes":

  • do not clear Cookies
  • do not clear Site Preferences

Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.

Clearing cookies will remove all specified (selected) cookies including cookies that have an allow exception and cookies from plugins.

more options

I have the same issue. I have set up permissions manager to keep cookies I want for some sites. It appears saved in Permissions Manager but does not perform the function. I still have to get security codes for quite a few sites that are texted, a charge every time I want to enter the site.

more options

Wait, am I missing something here! These proposed solutions do not work or at least not for me.

The "Exceptions" list only work for accepting or blocking the cookie when the site tries to store at at first, and Firefox doesn't use that list to determine which cookie to keep before it deletes all of them as it closes.

Setting the cookie life as "Allow for Session" from permissions page is the same as "Keep until I close Firefox", and they will simply delete ALL the cookie even for the sites that I have in the "Exceptions".

Again "Exceptions" only work if you block cookies by default for all but you want to allow some sites and not to whether keep or delete the cookie when closing firefox. The only way I found to do what the question asks is to use Add-ons (like Self-Destructing Cookies *does not work as expected too*) but until now (v24) Firefox cannot do it by itself.

由Fahad Alduraibi于修改

more options

With these settings you should be able to keep cookies from a specific domain.
If not then some extension might be interfering.


Let all cookies expire when you close Firefox.

  • Firefox/Tools > Options > Privacy > Cookies: Keep until: I close Firefox

Create a cookie 'allow' exception for cookies that you want to keep.

  • Firefox/Tools > Options > Privacy > Cookies: Exceptions

Make sure that you do not run Firefox in (permanent) Private Browsing mode (Never Remember History).
In Private Browsing mode all cookies are session cookies that expire automatically.

Be cautious with using "Clear history when Firefox closes" or clearing cookies otherwise.

If clearing cookies doesn't work then it is possible that the cookies.sqlite file that stores the cookies is corrupted.

Rename (or delete) cookies.sqlite (cookies.sqlite.old) and delete other present cookie files like cookies.sqlite-journal in the Firefox profile folder in case the file cookies.sqlite got corrupted.