為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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.