ghacks Technology News

Configure Firefox To Delete All Cookies On Exit But Select Ones

All web browsers accept cookies from all 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 again. Bad cookies on the other hand do not benefit the user, they track the user across multiple web properties for instance.

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 websites 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 Firefox 4 is used for the guide, the settings are however very similar in Firefox 3. Some screenshots may show the name Minefield instead of Firefox. This is the codename of Firefox 4 that was used during development.

firefox 4 cookies

Firefox users find all cookie settings under Firefox button > Options > Privacy. Firefox is configured to remember the browsing history by default. Users need to click on the Firefox will Remember History pulldown menu and select Use custom settings for history instead.

rememfer history

The important elements that appear after “use custom history” has been selected are:

  • Accept cookies from sites
  • Accept third party cookies
  • Keep until
  • Clear History when Firefox closes
  • Accept cookies from sites – The setting is enabled by default. It basically enables the use of cookies in the Firefox web browser. Users who disable the option will notice that no cookies are saved from that point on.
  • 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.

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.

clearing history firefox

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.

keep cookies until i close firefox

Cookies are now deleted on every exit. Now we need to configure cookies that we want to keep.

Option 1

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

exceptions cookies

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.

Option 2

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.

set cookies

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.

Blocking Cookies

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.

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.

Firefox add-ons

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.

Verdict

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.

Related Articles:

How To Whitelist Cookies And Delete The Rest Regularly
How To Delete Cookies On A Computer
Delete Flash Cookies
How to disable third party cookies in Firefox
Cookie Controller Gives Firefox Users Control Over Cookies

Enjoyed the article?: Then sign-up for our free newsletter or RSS feed to kick off your day with the latest technology news and tips, or share the article with your friends and contacts on Facebook, Twitter or Google+ using the icons below.



About the Author:Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand. You can follow Martin on Facebook or Twitter.

Author: , Wednesday March 9, 2011 -
Tags:, ,


Responses so far:

  1. jason says:

    Saving cookies like you describe does not work for me. I’ve never been able to get Firefox to save specific cookies where it will prevent me from having to login after I close the browser.

    I followed your directions explicitly in both 3.6.15 and 4 beta 12 and neither was able to save any cookies. Not sure why I’ve never been able to get this to work. I’ve tried for months.

  2. Taomyn says:

    “Accept third party cookies – Third party cookies are cookies that are set by scripts that are loaded on a website. A first party cookie comes on the other hand from the domain the user is on.”

    Funny you get it right in the second part of that. Shouldn’t it be “set by scripts that are loaded from _another_ website”?

    I always untick “Allow 3rd party cookies”.

  3. Chip says:

    Thankyou, you just let me retire my selectivecookiedelete addon.

  4. Thanks Martin, great post. I use the terrific CookieCuller addon to simplify the process:
    https://addons.mozilla.org//firefox/addon/cookieculler/

  5. Debianero says:

    Cookies in Firefox are easy to manage, the real problem and threat are Flash cookies.

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

Subscribe without commenting

© 2005-2012 Ghacks.net. All Rights Reserved. Privacy Policy - About Us