Quantcast

How to Recover Your Firefox Session When All Hope is Lost

Last week my house had some electrical issues, and our landlord came round to take a look at things. During this time, my computer got turned off without warning when a fuse was removed. It recovered fine, but next time I went to shut down in a hurry, Firefox was hanging around, and I wanted it dead. I chose to kill it and shut down—a mistake I would soon regret.

When the fuse and power were restored and my machine booted up again, I opened Firefox. It asked to do a session restore, as it had closed down with an error. That’s fine, no problem; I did force quit and the restore has always worked. Not this time. It DID load all my open tabs, probably about 100-130 or so… every single one of them… blank, with no URL. I don’t have all those tabs open at once, but in one session—most of which is stored in Firefox’s grouped tabs feature.

Many hours had gone into collecting those tabs. Several of them were tabs of projects put on pause, a few article resources, plans for future projects, random research and reading I wanted to finish at some time. All lost. I was under the false impression that Firefox by default stored several sessions, but sadly it does not. This can be achieved with a plugin which I’ll get to later.

I had a frantic panic and it took about half an hour to sink in that I’d probably never see those tabs again. Because I’d spent so many hours gathering them, however, I decided I’d try and get them back, somehow. I figured the data must be stored somewhere, and maybe Firefox just wasn’t loading the URLs because the file was corrupt.

After a bit of poking around and Googling, I found the profile data is stored in the appdata folder (%APPDATA%\Roaming\Mozilla\Firefox\Profiles\[RandomNumber]) on Windows (you may or may not have the “Roaming” folder). If you’re a Mac user, you should find the profile data at ~/Library/Mozilla/Firefox/Profiles/ or ~/Library/Application Support/Firefox/Profiles/. The files you’ll be looking for is sessionstore.js and sessionstore.bak. Firefox automatically creates a backup encase of crashes, but if like me, you opened and closed Firefox several times before realising this, you will have overwritten both these files several times.

At this point, I almost gave up. I figured the chances of recovering the session data file was pretty low. Having successfully used file-recovery software before, I decided to give it a shot. On Windows I use Recuva, made by the same people as CCleaner, and it’s free. If you’re on a Mac and you don’t have Time Machine or (for whatever reason) don’t have any form of backup enabled, you can have a look at some Mac-based alternatives.

Now I knew what file I was looking for, where it was, and how to recover it. Because of the way the NTFS file system works on Windows, when you delete a file (from the recycle bin), you actually just delete the index to the file, allowing that space to be reused. Recuva knows this, and searches for un-indexed files on the drive. It sometimes only recovers partial files, but I was lucky enough to find a completely untouched version of my sessions file.

After the file was recovered, I moved it to the correct location and re-opened Firefox. JOY! After the huge worry, I decided to installed Session Manager, a Firefox plugin which allows some clever session management features, like backing up x number of previous sessions, something I thought was already in place.

If you have had a similar horrible Firefox (or other browser-related) experience, let us know in the comments below.

This entry was posted in Browsers, HowTo, Internet and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

91 Comments

  1. Steve Fernandes
    Posted 31/03/2014 at 6:35 PM | Permalink

    “After the file was recovered, I moved it to the correct location and re-opened Firefox” – Sorry for my ignorance but where exactly is the ‘correct location’?

    • JD
      Posted 05/04/2014 at 8:03 AM | Permalink

      It’s the location mentioned in the fifth paragraph of the article.

      Mine looks something like
      C:\Documents and Settings\”username”\Application Data\Mozilla\Firefox\Profiles\”randomletters”.default\
      (no ” used)

      I have Default at the end as I have a couple of Firefox Profiles. This is in XP. It’s similar in Win7. Either way look for Profiles under Firefox. I’ve found it the same if using the Portable Apps version of it (the .paf version)

      The correct file for this correct location (also in para 5) is that ending in js and/or bak
      sessionstore.js and sessionstore.bak

      Have FX closed, place the sessionstore.js there, open FX.

      I had _many_ saved off sessions (crashes, panic shutdowns, weirdness, etc.) and once I had Session Manager added, spent a bit of time loading each of my old, saved away or recovered sessionstore.js in there, and one at a time opening FX, to save them off in the Session Manager format i.e. backup.session and others with default numbering i.e. backup-101.session or if one saves manually a name one gives it i.e. 2012-10-29.session

      I also made a file association for the file extension .session to open in Wordpad, editor2 or EditPadLite 7.

      Works a dream.

      Cheers, JD

  2. GregCB
    Posted 14/04/2014 at 1:12 AM | Permalink

    Great tip, saved my life! Many thanks to 2012 you!

  3. DoyleCC
    Posted 14/04/2014 at 6:12 PM | Permalink

    Wow! Great post! It saved me! I got my tabs back!!!

    I am using Windows 7 Pro. The full path is C:Users/UserName/AppData/Roaming/Mozilla/Firefox/Profiles/SomeString.default, where UserName is your Log-on name for the computer and SomeString is a random(?) string of characters (both letters and numbers) ending in “.default”. Open that folder and look for the file “SessionRestore.js”.

    Once you have recovered (using Recuva) the sessionrestore.js file that has the tabs you want, you may need to rename it because Recuva adds -1 and -2, etc. if there is more than one sessionrestore.js file recovered. Check the dates when the file was created and choose one safely prior to your Firefox crash. Copy it and paste it to your desktop, then rename it as “SessionRestore.js” (don’t include the “”). Copy the renamed desktop version, then paste it into the above location. If the paste operation gives you an error message, then first delete the existing SessionRestore.js file and retry the paste.

    If you don’t know how to get to the above location, then click on the “Start” button, then Open “Computer” (click on the “Computer” link), then open “Users”, then your UserName (see above), then “AppData”, then “Roaming”, then “Mozilla”, then “Firefox”, then “Profile”, then open the remaining folder (a string of characters ending in “.default”). Scroll down to “SessionRestore.js”. That is the file that needs to be replaced with the older version.

    IMPORTANT! Do this with Firefox closed! You must reopen Firefox to get your old session back, but if you already have Firefox running and then close it, it will overwrite your replacement SessionRestore.js file when it closes and you will have to do the replacement over again.

    Good luck!

    Thanks for the great post, Ben Hutton!

One Trackback

  1. [...] How to: Recover a lost Firefox session Share this:TwitterFacebookLike this:Like Loading… [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Welcome to TechRant…

    We are a group of techies from emerging students to full blown professionals who are enthusiastic about technology related subjects. Everyone has opinions and feelings about things, sometimes stronger than others. On TechRant, we will be sharing those opinions, and have a good ol' rant! We may also do non ranting type articles, like news, reviews, tutorials, tips and tricks, how-tos and even the odd interview.

  • Authors

  • Categories

  • Archives