Configure Firefox To Delete All Cookies On Exit But Select Ones
All web browsers accept cookies from websites in their default configuration. Cookies contain different information, from session data over individual site preferences to advertisement and tracking related data.
Cookies can generally be classified into good and bad cookies. The Internet user benefits from good cookies, for instance from cookies that contain session information. These cookies store the information that the user is already logged in on a specific site, e.g. Facebook or Yahoo Mail, so that the users does not have to enter the log in information on each page load again.
Bad cookies on the other hand do not benefit the user, they track the user across multiple web properties for instance and are generally speaking undesirable by most.
The following guide details how Firefox can be configured to allow cookies for specific websites that are beneficial to the user, and delete all other cookies that sites want to place on the computer system. Some users might even take an extra step and block all cookies but select ones in the browser.
Please note that the most recent version of Firefox is used for the guide, the settings are however very similar in older versions.
Configuring the cookie behavior in Firefox
Firefox users have two options to handle the deletion of cookies and site data in recent versions of the web browser.
- Load about:preferences#privacy in the browser's address bar to get started.
- The option "Delete cookies and site data when Firefox is closed" removes cookies and site data from Firefox when you exit the browser. You may add exceptions to keep cookies and site data for select sites.
- If you set the History to "Use custom settings for history", you get an option to "clear history when Firefox closes.
- A click on Settings displays an option to clear cookies when the option is activated.
You can load about:preferences#privacy in the Firefox address bar to open the browser's privacy preferences.
Scroll down to the History section and select "use custom settings for History" in the "Firefox will" menu.
The important elements that appear after "use custom history" is selected are:
- Accept cookies from websites
- Accept third party cookies
- Keep until
- Clear History when Firefox closes
Here are explanations for what each setting does:
- Accept third party cookies - Third party cookies are cookies that are set by scripts that originate from another website. A first party cookie comes on the other hand from the domain the user is on.
- Keep Until - The setting defines for how long cookies are stored by the browser.
- Clear History when Firefox closes - Configures Firefox to delete some or all history items, among them cookies.
Tip: Extensions may need cookies as well. Check out this guide to find out how to deal with those.
Delete Cookies On Exit, Keep Some
Firefox needs to be configured to keep some cookies while the rest gets deleted on exit. Start with a click on the Settings button next to "Clear history when Firefox closes". You may need to enable the option before it becomes available.
Remove the checkmark from Cookies. This configures Firefox to keep cookies on exit. Read on to find out why this is important. Close the menu with a click on OK.
Now click on the "Keep until they expire" pulldown menu and select "I close Firefox" from the options.
Cookies are now deleted whenever you exit the browser. Now we need to configure cookies that we want to keep.
A click on the Exceptions button opens a menu where cookie exceptions can be configured. Just enter the domain name of the website that you do not want cookies to be deleted for and the allow button afterwards to add it to the listing.
Cookies from domains in that list will not be deleted when Firefox exits. Cookies from domains not on the list will be deleted. Please note that this may result in you being automatically logged out of services on the Internet which you will notice when you open the service's website again.
You may also want to keep some third party cookies, for instance advertisement opt-out cookies. It may be a good idea to take a look at the Show cookies menu once you have finished the initial whitelisting of cookies to see if you missed any. Show cookies displays all cookies that are currently active in the browser.
The menu unfortunately has no option to allow specific cookies, which usually means lots of window switching before the cookie configuration has been completed.
Some users do not like to add web addresses to the cookie whitelist manually. Those users can use the following way instead. They need to be on the website that they want to whitelist.
A right-click on the page and the selection of View Page Info opens a window that displays information about the active website.
The Permissions tab offers to customize permissions for that specific domain. To allow cookies for the domain uncheck the Use Default option under Set Cookies and switch from Allow for Session to Allow.
Firefox will accept all cookies, most for the session, and the whitelisted ones until they expire. Some users may want to configure the browser to use even stricter rules. They have two options to achieve this.
Removing the checkmark from the "Accept third-party cookies" setting blocks all third party cookies in Firefox. That's the easiest way of blocking the majority of cookies in the web browser.
A less-strict option for third-party cookies is to switch the setting to "from visited". This blocks all third-party cookies but those set by sites you visited actively in the past.
The second option comes in the form of the Exceptions menu. The configuration menu can not only be used to allow cookies, but also block cookies from domains that are entered.
One of the greatest strengths of the Firefox web browser is its add-on engine. The following lists add-ons that add new options and functionality to the browser's cookies management.
- Ghostery - Displays tracking cookies with options to block them in the browser.
- Add & Edit Cookies+ - Adds functionality to analyse the contents of cookies.
Cookie Monster- Adds temporary cookies to Firefox, better cookie management and other interesting options.
Firefox can be configured to keep cookies from select websites and delete all other cookies on exit. The initial configuration takes some time and that is probably what keeps most users from configuring Firefox this way.
Update: The Firefox cookie whitelist option is not preventing cookies from being deleted after all. To protect cookies from being deleted, you need to use an add-on like Cookie Quick ManagerÂ which you can use for that purpose.Advertisement