We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

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.