[Tutor] Advice on working with Firefox's cookies.sqlite

Jim jf_byrnes at comcast.net
Sat Jun 27 14:31:30 EDT 2020


On 6/27/20 1:16 PM, Richard Damon wrote:
> On 6/27/20 2:02 PM, Jim wrote:
>> On 6/27/20 12:03 PM, Alan Gauld via Tutor wrote:
>>> On 27/06/2020 17:44, Jim wrote:
>>>
>>>> The problem is when I copy the file back to my profile directory and
>>>> use
>>>> preferences to check for cookies, the deleted cookies have reappeared.
>>>> This seems to be the result of a file called cookies.sqlite-wal in the
>>>> same directory.
>>>
>>> I assume you are closing all instances of Firefox down before copying
>>> the new file into place? Otherwise Firefox is probably overwriting it
>>> from a cache in memory or somesuch.
>>>
>>
>> No I am trying to do it without shutting down Firefox. I normally have
>> 3 instances of Firefox open. 2 private and 1 normal. It's the normal
>> one I am working on. At the end of the day I manually remove cookies I
>> don't want so I am trying to automate the process. If I had to
>> manually shut down all instances Firefox it would defeat the purpose
>> of automation. If I can't find another solution I may try to just
>> programmatically shut down the normal one, the private ones normally
>> have multiple tabs open and I don't want to close them. Years ago I
>> had a problem with Firefox crashing when trying to reopen tabs and
>> since then I have always turned that setting off.
>>
>> Regards,  Jim
> 
> Just because a program uses a sqlite database, doesn't mean that it
> intends for you to be able to interact with it by changing that
> database. You are probably locked out of directly operating on it by the
> program having a write lock on the database, thus blocking you from
> updating it.

I'm sure that is the case and is why I tried moving it.

> Deleting the file and replacing with the database open is one of the
> items on the list of how to corrupt your database. Likely the pages with
> the cookies are in program cache memory, and spooled out at some point
> when updated.

I didn't mention it but I do have a copy of both files right after I 
manually cleaned them from inside Firefox.

> I would look at writing a Firefox extension to do the cookie cleanup (if
> there isn't one already that does a close enough job) rather than
> something outside of Firefox.

I know I don't have the expertise to do that. Having to manually delete 
some cookies is not a big deal, I just enjoy programing with Python so I 
look for things I can automate.

Regards,  Jim
> 




More information about the Tutor mailing list