Restoring a Lost Firefox Session

For the most part, I'm very happy with Firefox as my primary browser. However, as someone who ends up with multiple windows open regularly, I occasionally find myself trying to close the browser without closing each window separately. Normally this is because some program is updating and complaining about Firefox being open.

The safe way to do this (on Windows) is to launch Task Manager and force quit, but every now and then I forget and right-click the open program in the toolbar, then close it from there. The issue with that approach is that Firefox seems to lose whichever window you trigger the "close all" feature on from the session state. All tabs, all data, lost immediately.

So far, when I've done this, the window lost has been one with a couple of tabs open and I've just shrugged it off. Sometimes I can even find them in the History panel if I'm lucky enough. Today, I did this with my main window, which has (well) over a hundred tabs and a bunch of specific pinned tabs all set up in a way I particularly want. Some of these tabs have been open for years and recovering it from History would be simply impossible. There was also no way to restore this window from the Firefox menu. I'll admit to getting a little panicked 😬

Luckily, it turns out there is a final, failsafe option you can use: cloning an old session state file from your profile! It's not perfect, but it restored the majority of my tabs and windows, which is better than nothing. So, for the next time I forget and have a minor heart attack, here are the steps I took:

  1. First, type in about:support to the Firefox address bar. This opens up a page where you can find your Profile Folder, as well as a button you can press to navigate to it directly in Explorer/Finder (it's in the first section, titled "Application Basics", about halfway down);
  2. Locate the sessionstore-backups folder and make a copy (i.e. to your desktop);
  3. Shut down Firefox (note: use the Task Manager this time 😅);
  4. Once Firefox is closed, delete the session store files from within the profile folder;
  5. Then, in your cloned folder, find the largest/oldest file. Copy this back into the profile folder – not the sessionstore-backups folder (that should have been deleted), but the root profile folder;
  6. Rename this cloned file to sessionstore.jsonlz4; if a file of that name already exists, delete it;
  7. Start Firefox back up, and the older session should be restored, hopefully containing any lost windows/tabs.

This is still a lossy process, as the older session store may predate some tab changes or other actions you've taken, but if you're like me and have lost tabs going back years then at least you know these will have been safely retrieved.

And let's not talk about the underlying issue of tab hoarding, okay 😉

Explore Other Articles

Further Reading & Sources

Conversation

Want to take part?

Comments are powered by Webmentions; if you know what that means, do your thing 👍

  • <p>Ever close Firefox or have a crash, restart it, and discover an entire window of tabs is missing? You can potentially resurrect that lost session state, if you act quickly enough.</p>
  • Murray Champernowne.
Article permalink