Session Restore is a useful feature in Firefox that remembers certain information about your previous browsing session so that you can continue work right where you left off the last time.
The feature saves open windows and tabs, the size of each window and its position on the screen, as well as all text that you have entered in forms in any of the open tabs.
When I look back, I can think of a couple of occasions where Session Restore failed to restore the previous session on my system. It was my fault sometimes, for instance when I disabled the "remember my browsing and download history" option in the browser's preferences. At other times it was the browser's fault.
I was in shock whenever that happened as I thought that I lost all of the open tabs in the browser. While I only have about 50 or so open at all times, I have usually not bookmarked the tabs which means that most of the information are lost for good.
Where the Session Restore files are stored
The browser stores the session file sessionstore.jsonlz4 in the user profile directory. This is the active session file that Firefox loads when you start the browser.
Firefox stores recovery files in the sessionstore-backups folder of the profile folder:
Mozilla changed the format of session backup files and that means that the previous way of restoring sessions needed updating.
May still be useful for old versions of Firefox, and Firefox-based browsers such as Pale Moon.
Mozilla has improved the Session Restore feature in Firefox 33. The core changes are as following:
While sessionstore.js is still stored in the main Firefox profile folder, all other files are now stored in sessionstore-backups instead. Note that sessionstore.js is only shown when Firefox is not open.
The primary backup file is recovery.js now, the secondary backup file recovery.bak. You can use the other session backups listed there as well to restore sessions.
You can still use these files and replace the sessionstore.js file in the main directory.
Additionally, you find previous.js and upgrade.js there as well. These files contain session information from the last shutdown or upgrade. They too can be used to replace the main sessionstore.js file should it be corrupt.
The new backup process
The restore files
As mentioned before, Firefox saves several new session restore files to the user profile directory once the new feature lands in the browser (Nightly users already have it as it lands in Firefox 33 if things go as planned).
The process in Firefox 33 to Firefox 55
Here is the order in which Firefox attempts to restore the previous session on start.
So what is different in comparison to the old session restore? First of all, you may notice that additional files are saved by the browser which increases the chance that one of the session restore files is not corrupt and working.
In addition, both the previous.js and upgrade.js files are not replaced as often as the two main session restore files. This provides another option of recovering a session if both primary session files are no longer working, or if you have started the browser several times after you noticed that the session was not restored properly.
The new system offers additional means to recover sessions manually as well. Previously you had to rely on the backup file only to restore a session if the main sessionrestore file was corrupt. Now, you can also try recovery.js or upgrade.js, both of which are usually created farther back in time making it more likely that they are not corrupt as well.
What many Firefox users do not know is that Firefox saves two files with Session Restore information to the user profile:
Restoring the Firefox session
Once you have backed up both session files, you can start to investigate the issue and try to restore the previous session.
First thing you may want to do is compare the size of the sessionstore.js and sessionstore.bak file. If either file has a size of 0, it is empty and not usable anymore.
With Firefox closed down completely, open one then the other file in a text editor of choice. It should display session information in text form. If you see corrupt text or no information at all, it is clear that the Session Restore file is corrupt and not usable anymore.
You can still try and extract web addresses from it if some information are still displayed in it. This may allow you to recover at least some websites that you had open previously.
Before you do so, try deleting the broken sessionstore.js file and rename the sessionstore.bak file to sessionstore.js.
This attempts to restore the browsing session from the backup. Note that it does not include tabs, windows or forms that you have opened in your last session, and that it may include tabs, windows or form data that you have closed in the previous session.
Recovering the session with help of the backup session file should work if the main file has been corrupted. It may not help you directly if a Firefox setting prevents the browser's Session Restore feature from working correctly.
You can however still open the file in a text editor to extract the information manually from it if they are still listed in the main or the backup file.
Tip: You may use the Firefox extension Session Boss to save and restore sessions.Advertisement
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.