I am looking for a way to automatically accept a cookie with a specific name, not based on site. The expected behaviour would be to block all cookies, unless its name contained foo in which case I would allow that cookie.

Most browsers give me an ability to reject all cookies except for an exemption list which can be set to automatically allow. However, the exemption lists all seem to be site based like so (Firefox 9.0.1);

Cookie Site Exemption

Does anyone know of an add-on or otherwise which can allow cookies by Name? This question is kind of the inverse of another Super User question which was resolved without blocking a cookie name: Firefox: how to block cookies by name, not by site?

Mock up of desired functionality;

Cookie Name Allow Mockup

  • I do realize that exemption by Cookie Name is a security issue. Security through obscurity and what not. I am just wondering if it is possible / has been done before. – krondor Jan 14 '12 at 0:56

I have been looking into a similar matter regarding cookies recently, but I didn't find and good Firefox add-on that can do this.

What you can do is to write a Greasemonkey script that deletes all cookies except the one(s) with the name you want.

| improve this answer | |
  • Yeah I was worried that would be the case, though I hadn't thought of using greasemonkey. Interesting work around. – krondor Jan 14 '12 at 0:53
  • I've left this open a bit and haven't seen any other ideas. I've accepted the greasemonkey workaround as the answer. Thank you for the idea! – krondor Jan 25 '12 at 15:21
  • Having accepted this: Have you written/found such a script meanwhile, and maybe would make it public? I'm interested in the very same topic, just the other way around: having discovered that some proxies "inject" cookies (which they claim to come from the visited site, google for "BCSI-CS- cookie" for details), I want to automatically reject those. – Izzy Mar 13 '14 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.