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!

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

搜索 | 用户支持

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

详细了解

Why do cookies persist after clicking "Clear Data"?

  • 5 个回答
  • 0 人有此问题
  • 1 次查看
  • 最后回复者为 ExpertN0vice

more options

Hi Mozilla community,

The Developer Tools -> Storage -> Cookies pane shows cookies currently being stored by Firefox.

If I close my browser, these cookies are automatically deleted. However, if I follow the steps on [1], the cookies are still there, and don't get deleted. *Why?*

Thanks in advance!

Steps to reproduce:

- Start a new Firefox session
- Open Developer Tools -> Storage -> Cookies and see that the list is empty
- Go to youtube.com and click Accept All on the cookies popup
- Developer Tools -> Storage -> Cookies now shows a cookie from YouTube, as per the attached screenshot
- Go to Settings->Privacy & Security->Cookies and Site Data -> Clear Data -> Clear
- Go back to Developer Tools -> Storage -> Cookies and click on the refresh icon
- The YouTube cookie is still there
- However either of the following actions will correctly delete this cookie:

1) closing firefox (with Always Use Private Browsing Mode enabled) 2) manually deleting the cookie from the list in Developer Tools -> Storage -> Cookies


[1] https://support.mozilla.org/en-US/kb/clear-cookies-and-site-data-firefox

Hi Mozilla community, The Developer Tools -> Storage -> Cookies pane shows cookies currently being stored by Firefox. If I close my browser, these cookies are automatically deleted. However, if I follow the steps on [1], the cookies are still there, and don't get deleted. *Why?* Thanks in advance! Steps to reproduce: - Start a new Firefox session - Open Developer Tools -> Storage -> Cookies and see that the list is empty - Go to youtube.com and click Accept All on the cookies popup - Developer Tools -> Storage -> Cookies now shows a cookie from YouTube, as per the attached screenshot - Go to Settings->Privacy & Security->Cookies and Site Data -> Clear Data -> Clear - Go back to Developer Tools -> Storage -> Cookies and click on the refresh icon - The YouTube cookie is still there - However either of the following actions will correctly delete this cookie: 1) closing firefox (with Always Use Private Browsing Mode enabled) 2) manually deleting the cookie from the list in Developer Tools -> Storage -> Cookies [1] https://support.mozilla.org/en-US/kb/clear-cookies-and-site-data-firefox
已附加屏幕截图

被采纳的解决方案

If you are in permanent Private Browsing mode (Always use Private Browsing mode; Never Remember History) then all session data is stored in memory and purged automatically when you close Firefox, so there is no need to use "Clear history when Firefox closes" and it doesn't have effect. What you see in "Cookies and Site Data -> "Manage Data" is data from the regular session and you can only clear this data in regular mode (i.e. you need to exit PB mode).

定位到答案原位置 👍 2

所有回复 (5)

more options

Hi Dropa, thanks very much for the reply.

If I understand correctly, you're saying that the Clear Data button doesn't delete the cookies for websites which are currently being used by Firefox. So if I'm on YouTube and click Clear Data, it doesn't delete the cookie for YouTube. Is that right?

I can delete the cookie while on YouTube by removing it via Developer Tools -> Storage -> Cookies.

So I'm trying to understand why, if the cookie can be deleted from the Developer Tools pane, the Clear Data button doesn't do the same thing. It feels like either I've misunderstood something about how cookies work, or the Clear Data button isn't very well documented, because it doesn't actually clear all the data.

more options

选择的解决方案

If you are in permanent Private Browsing mode (Always use Private Browsing mode; Never Remember History) then all session data is stored in memory and purged automatically when you close Firefox, so there is no need to use "Clear history when Firefox closes" and it doesn't have effect. What you see in "Cookies and Site Data -> "Manage Data" is data from the regular session and you can only clear this data in regular mode (i.e. you need to exit PB mode).

more options

Hi cor-el (or is that Clark?!)

Thanks for picking this up and yes this has answered the question.

In case this helps anyone in the future, I will just clarify a little.

It's not the "Clear history when Firefox closes" setting that I'm asking about. Rather, I was confused about why the "Clear Data" button, which refers to cookies, not history, doesn't delete the cookies.

However, cor-el's explanation applies equally to the Clear Data button: When permanent Private Browsing mode is switched off, this button deletes the cookies as expected.

The reason is that the Clear Data button deletes cookies stored on disk. In Private Browsing mode, cookies are held in memory. So the button appears to work, but doesn't actually do anything about the in-memory data.

One of the Firefox devs has clearly thought about this issue and put a little notification in Privacy->Cookies & Site Data explaining that the "Clear history when Firefox closes" setting isn't needed in Private Browsing mode. But the the Clear Data button remains enabled, suggesting that it still works even in Private Browsing mode.

One final note: although, with Private Browsing disabled, the cookies are deleted by the Clear Data button, they are still listed in Developer Tools -> Storage -> Cookies as if they were still there, even after refreshing that pane. That behaviour seems a bit iffy to me, but perhaps there's a reason.

Thanks again cor-el and Dropa for your help!

more options

I think that you should still be able to clear the cookies and other site data kept in memory in current releases, but you won't see this in "Manage Data". I think that the Storage Inspector should reflect this in a better way.

more options

I also agree with the statement, " think that you should still be able to clear the cookies and other site data" when in permanent private browsing. I am NOT knowledgeable in this area, but it doesn't seem logical to add, and maintain, code that forces the user to close the private browser to clear data when that is not required outside private browsing.

There are sites which allow one chance to solve a problem. Outside private browsing, clearing data, allows a replay. In private browsing the browser must be closed and reopened. if, as I do, there are several tabs this forces to reopen all pages.

Also, isn't the data available to other websites and if clearing data doesn't clear data it is seemingly unsafe to visit another website without first closing the browser.