for those running ephemeral Tor Browser instances in vanishing VMs, here is a script which shows what you need to instantiate your saved login cookies and avoid being effectually locked out by the Google CAPTCHA.
No technical support will be provided by me with this script. Figure it out. It is provided as documentation of badly undocumented stuff not made by me. I developed this by running diff(1) against prefs.js at various stages of configuration; if there exist any references, I would like to know about them.
#!/bin/sh
#
# Set this to the path containing subpath:
# "Browser/TorBrowser/Data/Browser/profile.default"
#
ffprofile="path/to/tor-browser/Browser/TorBrowser/Data/Browser/profile.default"
#
# Change this (duh).
#
case "${1}" in
nullius)
bcfuser="nullius"
;;
[Mm]eretrix)
bcfuser="meretrix"
;;
*)
echo "User not specified, or unknown user" >&2
exit 1
;;
esac
{
cat << EOF
# Turn off Tor Browser's no-disk-write mode:
pref("browser.cache.disk.enable", true);
pref("browser.download.manager.retention", 2);
pref("browser.privatebrowsing.autostart", false);
pref("permissions.memory_only", false);
pref("security.nocertdb", false);
pref("volatilePrivatePermissions", false);
pref("pref.privacy.disable_button.cookie_exceptions", false);
EOF
} >> "${ffprofile}/preferences/extension-overrides.js"
#
# permissions.sqlite could also be reconstructed with
# `sqlite3 -batch -bail -init permissions.sql -cmd .quit "${ffprofile}/permissions.sqlite"`
# using the SQL provided below. The important cookies are
# the SMF login tokens, of course.
#
cp -p permissions.sqlite \
"${bcfuser}/cookies.sqlite" \
"${bcfuser}/cookies-tor.json" \
"${ffprofile}"
permissions.sql:
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE moz_perms ( id INTEGER PRIMARY KEY,origin TEXT,type TEXT,permission INTEGER,expireType INTEGER,expireTime INTEGER,modificationTime INTEGER);
INSERT INTO moz_perms VALUES(1,'https://bitcointalk.org','cookie',1,0,0,1521640330020);
CREATE TABLE moz_hosts ( id INTEGER PRIMARY KEY,host TEXT,type TEXT,permission INTEGER,expireType INTEGER,expireTime INTEGER,modificationTime INTEGER,appId INTEGER,isInBrowserElement INTEGER);
COMMIT;
HTH, HAND.