About This Guide
This guide will show you how to configure Mozilla Firefox to keep cookies for specific websites only and delete the rest.
Why would I want to do this? This helps you to balance convenience, security, and privacy. It's convenient because it allows you stay logged into websites of your choosing. It also lets you keep cookies which store settings or opt-out cookies. It provides security because it will log you out of all other websites when you close the browser. It provides extra privacy from things like tracking cookies, which monitor your activities around the web. These cookies will be deleted everytime you close Firefox.
First, you have to ensure a few settings are configured properly, else things may not work properly.
If using Firefox 3.x, open Tools -> Options on the menu bar.
If using Firefox 4.x, click the main menu and click Options.
In the Options dialog, click the Privacy tab.
In the first dropdown menu, choose Use custom settings for history.
Look for the checkbox that says Clear history when Firefox closes.
If this box is unchecked, then you can skip to step 4.
But if this box is checked, then click the Settings button to the right.
In this dialog, make sure Cookies is unchecked and click OK.
If this is not disabled, then Firefox will delete all cookies when closing the browser. So this option must be disabled.
Make sure the option Accept cookies from sites is checked.
In the second dropdown, next to where it says Keep until, choose I close Firefox in that list.
Choose Websites to Keep Cookies For
Now that Firefox is properly configured, you just have to choose the websites which you want to keep cookies for. There are two different methods you can use.
Method 1: Exceptions List
Open up the Options dialog, click the Privacy tab, and click the Exceptions button.
From this dialog, you can manually enter websites to keep cookies for.
Type in the website you want to add, and click the Allow button.
Method 2: Page Info
Open up the website that you want to keep cookies for.
Right click anywhere on the page and click Page Info.
Alternatively, you can choose Tools -> Page Info.
Click the Permissions tab.
Under where it say Set Cookies, uncheck Use Default.
To the right, choose to Allow cookies for this site.
Firefox may not delete all of your cookies if your homepage is set to "Show my windows and tabs from last time". By following this guide, you are configuring Firefox to delete the cookies at the end of the session. When this is set as your homepage, it is resuming your previous session. I'm not sure why only some cookies are kept and others are deleted though.
Nov 16 2010 - Added extra note about setting homepage
Edited by Xinok, 17 November 2010 - 00:54.