How do I use Firefox' "sessionstore" files to restore my crashed session?

12,705

Solution 1

You can use the utility at http://firefox-session-restore.herokuapp.com/ to restore your tabs. Just paste in the contents of sessionstore.bak.

Solution 2

Open the most recent file (probably sessionstore.js) in an advanced text editor supporting regular expression search and replace (for example, TextPad and Notepad++).

Replace all

"entries":\[{"url":"([^"]*)"

with

\n\1\n

And the URLs of the last opened tabs will appear on every other line.

(Note on TextPad: you need to enable POSIX syntax in PreferencesEditor.)

Solution 3

Try sessionstore.js in your Profile folder.

Solution 4

I have encountered the same problem and didn't find any good solution to restore the sessionstore.bak file. Here is the solution that worked for me:

Assuming that your sessionstore.json (seamonkey) or sessionstore.js (firefox) is rather empty and you lost all your tabs. Assuming that your sessionstore.bak file is bigger and contains all your tabs, but simply renaming sessionstore.bak to sessionstore.json (or .js) doesn't work.

Here is how to restore all your tabs using the "sessionstore.bak" file:

  1. Close the browser, make a backup of the sessionstore.bak file and don't relaunch the browser, it would overwrite the file.
  2. Copy sessionstore.bak file to sessionstore.json (or .js for Firefox).
  3. Edit the sessionstore.json file with a decent editor that doesn't cut long lines (the file is a 1 line JSON file that can contain several MB of data!). I have used vi successfully.
  4. At the beginning of the file, you will see something like this:

    {"windows":[],"selectedWindow":0,"_closedWindows":[{"tabs":[{"entries":[{"url":
    

    Simply replace this line by this (basically we remove the selectedWindow and _closedWindows fields):

    {"windows":[{"tabs":[{"entries":[{"url":
    

    (with vi editor, just place the cursor after the first opening square bracket, then hit [SUPPR] the required number of times, then hit : W Q Enter)

  5. Open your browser, and now all the tabs should appear as before :-)

This is a "works for me" solution!

Share:
12,705

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin almost 2 years

    My Windows XP system crashed. Usually about:sessionrestore shows me my previous session. But this time, after I rebooted, the page appeared blank.

    I was able to find my sessionsstore files in my profile folder. They have names like sessionstore-1.js through sessionstore-8.js. There is also a sessionstore.bak, which was probably created when the system crashed. I don't trust the sessionstore.bak: it's really small in size.

    Can I use sessionstore-8.js instead to get back my old sessions?

    Also, how exactly do I go about this? Should I quit Firefox before making any changes under the profile directory?

  • Nicolas Barbulesco
    Nicolas Barbulesco over 10 years
    This page has failed with several of my files. A big lack of this page is that it does not say what it is supposed to do.
  • Johnny
    Johnny over 10 years
    Can you provide the data on which it failed?
  • Rucent88
    Rucent88 about 10 years
    I have over 100 urls in my sessionstore.bak. The website only appears to display about 15 of them.
  • Johnny
    Johnny about 10 years
    hi @Rucent88, is there any chance you could provide me with the file so I can see what's going wrong?
  • Dmitry Grigoryev
    Dmitry Grigoryev over 8 years
    How is removing the sessionstore-##.js files supposed to help the OP, when he wants to restore the session from one of those files?
  • Peter Mortensen
    Peter Mortensen over 7 years
    In UltraEdit I had to escape { for it to work : "entries":\[\{"url":"([^"]*)" (I used "Regular Expression Engine" set to "Perl".)
  • Peter Mortensen
    Peter Mortensen over 7 years
    The URLs of the result can be fished out with the regular expression ^https*:// (using a line-filtering method - this is at least possible in both Notepad++ and UltraEdit).
  • Mark Jeronimus
    Mark Jeronimus over 7 years
    Aren't you forgetting other possible protocols like http:, ftp:, file:, etc
  • Peter Mortensen
    Peter Mortensen over 7 years
    Yes, but not http. It is covered by s*. I was thinking of normal web pages.