Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

firefox doesn't remove expired cookies

  • 16 replies
  • 18 have this problem
  • 90 views
  • Last reply by cor-el

more options

I thought that all expired cookies should be deleted automatically by the browser. but that is not the way it happens in my Firefox (same behaviour for different web-sites).

closing Firefox and even reboot of the computer don't help. the only way to remove expired cookies from Firefox is: by hand (which means I have to choose cookie in Privacy Tab of Firefox Options and press button 'Delete cookie').

well, the good news: expired cookies are ignored by the servers (tested with user script through my virtual server) but for unknown reason still continue to be stored idle in Firefox.

Is that the way it should work?

I thought that all expired cookies should be deleted automatically by the browser. but that is not the way it happens in my Firefox (same behaviour for different web-sites). closing Firefox and even reboot of the computer don't help. the only way to remove expired cookies from Firefox is: by hand (which means I have to choose cookie in Privacy Tab of Firefox Options and press button 'Delete cookie'). well, the good news: expired cookies are ignored by the servers (tested with user script through my virtual server) but for unknown reason still continue to be stored idle in Firefox. Is that the way it should work?

Chosen solution

From the bug reports it seems that Firefox isn't removing expired cookies automatically. This will only happen if you exceed the maximum storage limit of 3000 cookies. Removing expired cookies seems to be something that would have to be done in idle time because doing it a startup or close down will affect the performance negatively.


  • Bug 576347 - Periodically purge expired cookies and vacuum db

Please do not comment in bug reports: https://bugzilla.mozilla.org/page.cgi?id=etiquette.html
You can vote to show your interest in getting the bug resolved: https://bugzilla.mozilla.org/page.cgi?id=voting.html.

Read this answer in context 👍 2

All Replies (16)

more options

It is possible that the cookies.sqlite file that stores the cookies is corrupted if clearing cookies doesn't work.

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


Are you closing the tabs with those websites before closing Firefox?

If you leave tabs open then Firefox stores the cookies in sessionstore.js as part of the session data.

more options

my Firefox's default behaviour on start is to open home page, but not to restore previously opened tabs. so I don't thing it has somehting to do with sessionstore.js

more options

Go to Tools >> Options >> Privacy >> in the option "Firefox will:" change to "Never Remeber History", restart Firefox, now the history isnt remeber anymore

more options

Diego Victor, is that your solution? why not then uninstall Firefox at all?

Modified by alexey095

more options

You can clear the recent history:

That option that i said will delete automatically the cookie ever you close Firefox, then in the next time you start FIrefox, it will start with a new history cookies etc..

Modified by Diego Victor

more options

yes I did. I cleared cookies already and removed cookies.sqlite from profile directory. I will wait for a while and tell you if this solved my problem. but I still need my history to be remembered for future. without this every time I start Firefox I'll have to re-enter login and password to enter faceboook, youtube and other web-sites.

Modified by alexey095

more options

That option to clear the recent history you can uncheck history and passwords if you dont want to clean it History Win3

Modified by Diego Victor

more options

how about other settings for these web-sites (such as Language settings, for example, and other...)? if my history gets cleared every time I close Firefox, next time I'll have again to change these settings for each site. so, it's not the option. I still need Firefox to remember my history. the original question was: why expired cookies are not removed automatically? is that normal behavior?

Modified by alexey095

more options

You need to remove stored cookies when you make changes to the cookie setting under history. A new, changed, cookie setting only applies to newly created cookies and not to cookies that already exist. Those keep their current expiration setting.

Details like websites remembering you (log you in automatically) are stored in a cookie.

  • Create a cookie 'allow' exception to keep such cookies, especially in case of secure websites and when cookies expire when Firefox is closed.
  • Tools > Options > Privacy > Cookies: Exceptions

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

  • do not clear the Cookies
  • do not clear the 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 with an allow exception that you would like to keep.

more options

sorry, guys, what you are talking about is quite understandable but have no use to this problem. I don't need to clear my history, use custom settings for history, etc... I'm just asking a simple question. why cookies with expired date are still piled up in Firefox whereas they are supposed to be removed automatically (and now I'm not talking about session cookies).

more options

What are the current cookie settings?

You can inspect and manage the permissions for all domains on the about:permissions page or for the domain in the currently selected tab via these steps:

  • Click the "Site Identity Button" (globe/padlock) on the location bar
  • Click "More Information" to open Page Info
  • Go to the Permissions tab
  • Tools > Page Info > Permissions

You can delete the permissions.sqlite file to reset all permissions.

more options

Modified by alexey095

more options

Do you have two or more profiles in Firefox?

more options

one default profile. I didn't make much changes to the default settings. just installed a couple of add-ons, such as Scriptish and Adblock Plus.

more options

I removed cookies.sqlite from profile directory. but after a couple of days I found 'new' expired cookies. so, I may conclude, it's just 'normal' behavior of Firefox to store expired cookies in its database even though they are not in use anymore.

more options

Chosen Solution

From the bug reports it seems that Firefox isn't removing expired cookies automatically. This will only happen if you exceed the maximum storage limit of 3000 cookies. Removing expired cookies seems to be something that would have to be done in idle time because doing it a startup or close down will affect the performance negatively.


  • Bug 576347 - Periodically purge expired cookies and vacuum db

Please do not comment in bug reports: https://bugzilla.mozilla.org/page.cgi?id=etiquette.html
You can vote to show your interest in getting the bug resolved: https://bugzilla.mozilla.org/page.cgi?id=voting.html.

Modified by cor-el