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

搜索 | 用户支持

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

详细了解

Why is cookies.sqlite bigger than it's supposed to be?

more options

This article http://kb.mozillazine.org/Cookies states that cookies are mainly recorded in cookies.sqlite and permissions.sqlite . It also says that "Sometimes removing the cookies in the Cookie Manager is not sufficient and you need to delete the file that stores cookies in your Firefox profile folder ("cookies.sqlite" [...])".

I erased all my cookies (going to "Options" -> "show cookies" no cookies could be found), but my cookies.sqlite file still had 2.5 mb. I opened the cookies.sqlite file with DB Browser For SQLite and, as a matter of fact, nothing was shown (I even ran "SELECT * FROM table_name", no results also). But when I opened it with Notepad++, I could find a great number of sites in it.

The permissions.sqlite also has 6.5 mb.

What's going on here? Why is it also necessary to "delete the file that stores cookies in your Firefox profile folder" sometimes? I mean, why were those sites there if the table was supposed to be empty and no cookies could be found by Firefox?

This article http://kb.mozillazine.org/Cookies states that cookies are mainly recorded in cookies.sqlite and permissions.sqlite . It also says that "Sometimes removing the cookies in the Cookie Manager is not sufficient and you need to delete the file that stores cookies in your Firefox profile folder ("cookies.sqlite" [...])". I erased all my cookies (going to "Options" -> "show cookies" no cookies could be found), but my cookies.sqlite file still had 2.5 mb. I opened the cookies.sqlite file with DB Browser For SQLite and, as a matter of fact, nothing was shown (I even ran "SELECT * FROM table_name", no results also). But when I opened it with Notepad++, I could find a great number of sites in it. The permissions.sqlite also has 6.5 mb. What's going on here? Why is it also necessary to "delete the file that stores cookies in your Firefox profile folder" sometimes? I mean, why were those sites there if the table was supposed to be empty and no cookies could be found by Firefox?

被采纳的解决方案

When you delete data, I think the database engine clears an index or resets a row pointer and doens't overwrite the previously saved data So when you look at the raw data, you see the content of rows that Firefox no longer sees.

SQLite has a "vacuum" function to compact the database file and flush away stray bits, but there's no built-in feature in Firefox to trigger it.

定位到答案原位置 👍 0

所有回复 (3)

more options

Database programs often preallocate disk space in large chunks and do not surrender it back to the OS when you delete a few items. I'm not aware of any built-in function of Firefox to slim the database on demand, although some database maintenance may occur in the background from time to time. If you want to free some space, you can delete the file yourself (when Firefox is closed).

more options

Thank you for your reply, jscher2000!

I can perfectly understand the preallocation done by the database, but my question is not why the database has a bunch of null entries, but why is it recorded in the database file many sites (e.g. "economist.com Ì???'???economist.com Ì???'???economist.com Ì???'??? ") that I cannot access in the database.

To be clearer: when I open the cookies.sqlite with Notepad++ I can see many of such website entries (economist.com, ebay.com, etc.). But when I try to access the database using DB Browser For SQLite, the database doesn't show any record, it is empty (I think this is why Firefox can't show me any cookies, like I said in the original post).

Why are these website entries there in the file but not in the database? Could this be some kind of malware exploit?

more options

选择的解决方案

When you delete data, I think the database engine clears an index or resets a row pointer and doens't overwrite the previously saved data So when you look at the raw data, you see the content of rows that Firefox no longer sees.

SQLite has a "vacuum" function to compact the database file and flush away stray bits, but there's no built-in feature in Firefox to trigger it.