Firefox stores bookmarks and history in places.sqlite in the Firefox profile folder. https://suppor

Firefox stores bookmarks and history in places.sqlite in the Firefox profile folder.

https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data

In case you use "Clear history when Firefox closes" or otherwise clear history.

do not clear the "Browsing history"

See also the settings for "Clear history when Firefox closes".

Settings -> Privacy & Security
Firefox will: "Use custom settings for history":
[X] "Clear history when Firefox closes" -> Settings

https://support.mozilla.org/en-US/kb/delete-browsing-search-download-history-firefox

using "Clear history when Firefox closes" in Firefox 102+ honors exceptions and keeps cookies with an allow exception, previous versions removed all cookies

clearing "Site settings" clears exceptions for cookies, images, pop-up windows, and software installation and exceptions for passwords and other website specific data