This thread was archived. Please ask a new question if you need help.
Cookies are removed if Firefox quits in an unexpected way
I've noticed that every time Firefox is shut down in an unexpected way (for example if Firefox crashes, if there is a power failure or something else), all my cookies appear to be removed. When I open Firefox the next time, my tabs are restored, but no cookies seem to have been remembered. There is no problem at all when I close Firefox normally.
What could the cause of this problem be? Is there a way of solving it?
Modified by GAPa
That sounds to me like the most likely cause unless there are other reasons like using "Clear history when Firefox closes" or Private Browsing mode or clearing cookies otherwise (e.g. cleanup software).Read this answer in context 👍 1
All Replies (8)
Are you using private browsing mode?
Do you have a lot of crashes?
If you have submitted crash reports then please post the IDs of one or more recent crash reports that have a "bp-" prefix:
You can find the IDs of the submitted crash reports on the about:crashes page.
- You can open the about:crashes page via the location bar, like you open a website, or open this page via "Help > Troubleshooting Information".
No, I don't use private browsing.
Modified by GAPa
I definitely don't get a lot of crashes, but on the few occasions when I do, my cookies are lost. The last time it happened was the other day. Then I had to force-restart my computer for an unrelated reason. This doesn't happen very often either, so the problem doesn't occur to me that commonly. It's annoying when it happens, though.
I don't seem to have had a crash report with a bp prefix since 22 September. I don't remember if I had this problem then. I could probably make the problem occur by closing Firefox.exe in Task Manager. Would I be able to generate such a crash report that way?
Edit: To answer your first question, I believe all cookies disappear. It doesn't seem to matter if it's a cookie from one of the websites in the restored tabs or from a completely different site. I'm still logged in in the restored tabs, but the cookies clearly aren't remembered, at least not next time I start Firefox.
Modified by GAPa
If you have to force Firefox to close unexpectedly then files may get corrupted forcing Firefox to start with fresh database files. You can never guarantee that there won't be dataloss in such cases. You could create a backup copy of the cookies.sqlite file, but this still wouldn't guarantee that the restored cookies are still valid.
- Cookie Exporter: https://addons.mozilla.org/firefox/addon/cookie-exporter/
- Cookie Importer: https://addons.mozilla.org/firefox/addon/cookie-importer/
Aha, so in other words the thing that happens is that when Firefox closes unexpectedly, the file where the cookies are stored gets corrupted? I suppose that makes sense.
In that case I suppose the best solution is to schedule a daily backup of cookies (and perhaps settings as well just in case, even though they've never disappeared for me)? I'll try to do that then. Thanks for your help.
That sounds to me like the most likely cause unless there are other reasons like using "Clear history when Firefox closes" or Private Browsing mode or clearing cookies otherwise (e.g. cleanup software).
Since it only happens when Firefox closes unexpectedly I don't think the other possible reasons you mention could be the cause of the problem. I'll make sure to schedule daily backups of cookies, which will hopefully solve the problem. Thanks once again.