Cookie exceptions disappear in Firefox 17 vs 16

User Help for Mozilla Firefox
-ck-
Posts: 219
Joined: November 6th, 2004, 1:40 am

Cookie exceptions disappear in Firefox 17 vs 16

Post by -ck- »

Upgrading to firefox 17, about 90% of the cookie preferences disappear (allow per session, block, etc)

Downgrading back to firefox 16, all are restored just fine, back to 17 and most of them disappear.

I've examined the permissions.sqlite file and there is no corruption, they are all there, vaccum has no change.

Also tried 18.0b1 and it has the same problem, downgrade back to 16 fixes it.

Thanks for any advice.
User avatar
Gopher John
Posts: 1764
Joined: May 8th, 2008, 3:42 pm
Location: Northwest Ohio

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by Gopher John »

I am also having problems with cookie exceptions since the update to Firefox 17. On my WinXP Pro SP3 machine with 6 Windows user accounts and 7 profiles (one user has 2 profiles), long existing exceptions have disappeared for a few domains. On my Win7 Pro SP1 machine with 3 Windows user accounts and 4 profiles (one user has 2 profiles), the same thing has happened. This affects all profiles on all machines.

To add to this problem, I can add those missing exceptions back in and be able to access the forums as normal. However, on closing Firefox those or any other added exceptions added during the previous session are again missing. Prefs.js and Permissions.sqlite are not marked read-only.

Hopefully, there will be something in Prefs.js that can be modified. I really don't want to throw away all the various changes included there, especially if there is some other way. -ck-'s experience with downgrading back to Firefox 16 implies that something changed with Firefox 17.0 that cause this problem.

Edit:
I've tried Firefox Safe Mode with a couple of the profiles on both machines to no avail. On a clean profile on the WinXP machine, I was able to add a cookie exception that survived a Firefox restart. I haven't tried yet with a new profile on the Win7 machine.
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. - Albert Einstein
-ck-
Posts: 219
Joined: November 6th, 2004, 1:40 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by -ck- »

Okay I wasted an entire morning to fix this, and the good news is it's possible to fix, the bad news is there is no automated way (at least not until someone smarter writes some code).

--------------------------------------

The reason why this is happening is Firefox 17 and Firefox 18 are barfing on bad entries, or at least entries it does not like in permissions.sqlite

So it just silently discards them, no errors, no warnings, just stops processing the permissions

Which is dangerous btw because not only does it contain cookie rules, it has many other kinds of rules.

Until Firefox 4 or 5, it was called hostperm.1 and was a flat text file so it could be easily examined or edited.

Here's what I had to do, it's a messy writeup but once you understand what I'm doing it's straightforward:

------------------------
TL;DR summary:
1. export permissions.sqlite to hostperm.1 while in Firefox 15/16 using an extension
2. edit hostperm.1 to remove bad entries that are stopping processing
3. remove permissions.sqlite while leaving hostperm.1 in place
4. upgrade firefox to 17/18 and it will import hostperm.1 and convert to new permissions.sqlite
------------------------

Long version:

First you need to see all the rules in permissions.sqlite

GO BACK (downgrade) TO FIREFOX 15 (or maybe even 16) to do this, NOT NEWER or you will lose rules.

Then install this plugin: https://addons.mozilla.org/firefox/addon/exexceptions/

Note: the IMPORT in execeptions no longer works - you have to use another trick below to solve this.

The plugin can only be accessed via the extensions menu, find it and hit options or go to chrome://exexcept/content/exexcept.xul

USE THE EXPORT feature in the plugin (extension)

It will make an old school flat text file called hostperm.1

Put it into your Firefox 17/18 profile

- you are using old firefox right? Because if you are not, the hostperm file will be missing entries!

Now, shutdown Firefox 15/16

Go into your profile folder for Firefox 17/18

Rename or delete or move somewhere else the permissions.sqlite file

Now make a backup copy of hostperm.1

Now edit hostperm.1 with notepad or any text editor

Look for weird entries: I found two that were making firefox 17/18 barf

One was a single character domain, the letter e, might have been a typo

Another was scheme:file (which was to allow popups from file://filename.htm for testing)

Either remove bad lines or put a # in front of the line which will turn it into a comment line.

Now copy that file to your Firefox 17/18 profile or upgrade your firefox.

MAKE SURE permissions.sqlite IS REMOVED OR RENAMED in that profile folder

Firefox 17/18 will then proceed to convert the hostperm.1 file into the new permissions.sqlite format

Double check your cookie list and also go into that plugin and examine the entire rule set to see if they are all there.

The nice thing about the export from that plugin is it becomes alphabetical - so you can see where the cookies or other rules cut off, to find the bad rule.

But here's the thing, right where it cuts off is not necessarily the bad rule.
You might have to look a few rules further down, it seems to do them in a batch and once it fails, a few earlier ones go missing too.

I now have full A-Z (and IP addresses) all converted so I am confident it's working.
Stephen_C
Posts: 20
Joined: August 27th, 2009, 8:08 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by Stephen_C »

-ck- wrote:Okay I wasted an entire morning to fix this, and the good news is it's possible to fix, the bad news is there is no automated way (at least not until someone smarter writes some code).


[Snip]

Thank you so much for all your work and the detailed explanation. I had the same problem, followed what you suggested and am now able to run Firefox 17 without problems. I am most grateful to you for the time taken not only in identifying the problem but also in writing such a detailed explanation and solution.

Stephen
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by LoudNoise »

That seems worthy of a bug.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
-ck-
Posts: 219
Joined: November 6th, 2004, 1:40 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by -ck- »

User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by LoudNoise »

Not a bad bug. Not a great one either. Less emotion next time.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
-ck-
Posts: 219
Joined: November 6th, 2004, 1:40 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by -ck- »

Less emotion? Are we robots or humans?
User avatar
sbt
Posts: 72
Joined: December 1st, 2004, 4:56 pm

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by sbt »

"Less emotion next time."
?
the only good bug is a squashed dead bug
;-)
flaneurb
Posts: 622
Joined: December 10th, 2011, 3:50 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by flaneurb »


Status still "unconfirmed".
Maybe related but about:permissions seems to function in an unpredictable way. Sometimes I see a list of sites which fits with what I see with Alt, Edit, Preferences, Privacy, Remove individual cookies. Other times, hardly any sites are listed in about:permissions.
-ck-
Posts: 219
Joined: November 6th, 2004, 1:40 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by -ck- »

I'm embarrassed to learn that firefox has had about:permissions for over a year now and I didn't know about it.

But since it cannot export it from there I would have needed exexceptions extension anyway, so it worked out.

I kind of like the widescreen version in exexceptions anyway since it shows all the rules at once for each site.

Just needs to be updated for fullscreen support.

Actually, exexceptions has a few more fields that about:permissions doesn't have
https://addons.cdn.mozilla.net/img/uplo ... /21079.png
I wonder if they are all still supported under FF17 since it was written for Firefox4
VanillaMozilla
Posts: 13808
Joined: November 7th, 2005, 11:26 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by VanillaMozilla »

1. I think the bug report is fine except for the steps to reproduce. You need to be explicit. You should tell exactly what steps to take, and post an actual line that causes the error. Attach the whole file, assuming that you can do so without privacy problems.

I have to wonder if the file could not be parsed because possibly you had edited it and munged it by hand?

2. To see all the about: pages, view about:about.
-ck-
Posts: 219
Joined: November 6th, 2004, 1:40 am

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by -ck- »

I've never edited hostperm.1 or permissions.sqlite directly before.

I've upgraded Firefox since version 3 without problems, this is the first major issue I've run into.

There are several people with this identical problem so it's not just me.

They've definitely tightened the regulations as to what can go into permissions, they just forgot to deal with existing rules.

I am sure they will spot it after examining the code the loads and parses permissions.

Since I got mine working already I'm in no rush, but it would be nice to make sure people who have been loyal to Firefox over the years don't give up in frustration when they get stuck on this.

Now I need to tackle the next problem with 17/18 - despite having "animate once" set for gifs, some gifs repeat anyway. Doesn't happen in 16. I need to figure out the exact circumstances - but that's for another thread.
Bozi7
Posts: 23
Joined: March 28th, 2008, 2:57 pm

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by Bozi7 »

Not sure if it's related, but yesterday all my cookies got wiped for no reason. Today I checked the profile folder, for some reason the old cookies.sqlite was, in fact, renamed to cookies.sqlite.bak and a completely new cookie file was created (which for some reason failed to keep me logged in a certain site even after I redeleted it several times). After I removed the .bak from the end of the old file everything was back to normal and it even kept me logged into that site. What's the deal with this and why'd it even randomly decide I need to start cookies anew? F'd up cookie preferences? Glitchy permissions? Never had this happen before FF17
User avatar
Gopher John
Posts: 1764
Joined: May 8th, 2008, 3:42 pm
Location: Northwest Ohio

Re: Cookie exceptions disappear in Firefox 17 vs 16

Post by Gopher John »

This problem seems fairly common. See http://www.ghacks.net/2012/11/22/firefox-not-saving-cookie-exceptions-anymore/. The suggested fix in that article is to delete permissions.sqlite. Does that only affect what is shown in about:permissions or are some other settings removed also?

A post in another forum suggested resetting Firefox to it's default state using the button in Troubleshooting information. Both of the suggestions result in having to start anew to some extent.

An example of what caused me to notice the problem was that I was no longer remembered as logged into forum.avast.com. The cookie permission for that forum was missing after updating to Firefox 17 via the interface. When I allowed cookies for the forum, I immediately was remembered so the cookies did exist in the Firefox profile. I closed Firefox, and the cookie permission in cookies exceptions was again missing. All cookies that I've allowed still exist, but if the cookie exception is missing it is inaccessible to the site when visited until allowed.

I have all my profiles from Firefox 16.0.2 backed up. However, closing Firefox and replacing the current permissions.sqlite does not fix the problem. On restart, forum.avast.com and a few others that were removed with the Firefox 17 update are again removed. Forums.mozillazine.org was not among the ones removed.
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. - Albert Einstein
Post Reply