[Tutor] Advice on working with Firefox's cookies.sqlite
Richard Damon
Richard at Damon-Family.org
Sat Jun 27 14:16:54 EDT 2020
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.
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 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.
--
Richard Damon
More information about the Tutor
mailing list