cancel
Showing results for 
Search instead for 
Did you mean: 

firefox doesn't remove expired cookies

SOLVED
Highlighted
New Contributor

firefox doesn't remove expired cookies

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Site Moderator

Re: firefox doesn't remove expired cookies

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.

16 REPLIES
Site Moderator

Re: firefox doesn't remove expired cookies

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.

New Contributor

Re: firefox doesn't remove expired cookies

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

Support Forum Moderator

Re: firefox doesn't remove expired cookies

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

New Contributor

Re: firefox doesn't remove expired cookies

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

Support Forum Moderator

Re: firefox doesn't remove expired cookies

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..

New Contributor

Re: firefox doesn't remove expired cookies

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.

Support Forum Moderator

Re: firefox doesn't remove expired cookies

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

New Contributor

Re: firefox doesn't remove expired cookies

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?

Site Moderator

Re: firefox doesn't remove expired cookies

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.