Firefox session data is stored in the sessionstore-backups folder within your specific Firefox user profile directory. While many assume the current session is a single file, Firefox actually maintains a rotating set of backup files to prevent data loss during crashes.
The primary file used for the active session is sessionstore.jsonlz4, but this file is often locked or rewritten during active use. For recovery purposes, you must look in the backups folder where the browser saves snapshots of your open tabs and windows at regular intervals.
Profile Paths Across Operating Systems
Because Firefox creates a unique profile name for every user (a string of random characters ending in .default or .default-release), the exact path varies by machine. You must locate the general Profiles folder first, then enter the folder that matches your current active profile.
| Operating System | Root Profile Path | Session Subfolder |
|---|---|---|
| Windows | %AppData%\Mozilla\Firefox\Profiles\ | sessionstore-backups\ |
| macOS | ~/Library/Application Support/Firefox/Profiles/ | sessionstore-backups\ |
| Linux | ~/.mozilla/firefox/ | sessionstore-backups\ |
Labels and folder names may differ slightly depending on the version of the browser you are using. On Windows, typing %AppData% into the File Explorer address bar is the fastest way to jump to the Roaming folder where these files reside.
Session Files and Their Functions
Firefox does not save your session as a plain text file. It uses a compressed JSON format called LZ4, which reduces the file size and speeds up the loading process when you restart the browser. You cannot read these files with a standard text editor like Notepad or TextEdit without a decompression tool.
Inside the sessionstore-backups folder, you will find several files with different naming conventions. The recovery.jsonlz4 file is the most current snapshot of your session. If that file is corrupted, the previous.jsonlz4 file contains the state of the browser from the last successful full shutdown.
Additionally, you will see files named upgrade.jsonlz4-YYYY-MM-DD. These are created when the browser updates to a new version, ensuring that your open tabs are carried over to the new installation. These are often the safest files to use if you are trying to recover tabs from a session that occurred several days ago.
Recovering Lost Tabs from Backup Files
If Firefox fails to restore your session automatically, you can manually replace the current session file with a backup. This process requires the browser to be completely closed, as Firefox overwrites the session file upon exit.
- Close Firefox entirely. Ensure no background processes are running in the Task Manager or Activity Monitor.
- Navigate to your profile folder as described in the paths above.
- Open the
sessionstore-backupsfolder. - Find the backup file you wish to restore, such as
recovery.jsonlz4. - Copy this file and move it up one level into the main profile folder.
- Rename the copied file to
sessionstore.jsonlz4. If a file with that name already exists, rename the old one tosessionstore_old.jsonlz4first to avoid permanent data loss. - Restart Firefox.
If the browser opens and the tabs are still missing, check the Menu > History > Restore Previous Session option. Sometimes the manual file replacement requires a manual trigger within the interface to load the data into the active window.
Session Storage Misconceptions
A common misconception is that clearing your browser cache or history deletes your session storage. This is incorrect. Clearing the cache removes temporary images and scripts from websites, and clearing history removes the list of visited URLs, but the session store is a separate mechanism that tracks the actual state of open windows and tabs.
Another common error is attempting to open sessionstore.jsonlz4 in a browser or text editor to find a specific URL. Because the file is compressed, it will appear as gibberish or binary code. To view the contents, you must use a specialized LZ4 decompression tool or a web-based session recovery tool that can parse the JSON data.
Managing Session Persistence Settings
You can control how Firefox handles this stored data through the internal settings. If you find that your sessions are not being saved or are being cleared too often, you need to adjust the startup preferences.
Navigate to Settings > General. Under the Startup section, check the box for Open previous windows and tabs. When this is disabled, Firefox may still create backup files for crash recovery, but it will not load them automatically when you launch the application.
For users who require more granular control, the about:config page allows you to modify how often backups are taken. Searching for browser.sessionstore.interval reveals the frequency (in milliseconds) at which Firefox writes the current session to the disk. The default is typically set to 15000 milliseconds, or 15 seconds, meaning your data is rarely more than a few seconds old in the event of a power failure.
Example Recovery Scenario
Imagine a scenario where a computer crashes, and upon rebooting, Firefox opens to a blank home page instead of the 20 tabs you had open for a research project. You check the main profile folder and find sessionstore.jsonlz4 is 0 KB, meaning it was corrupted during the crash.
You navigate to sessionstore-backups and see three files: recovery.jsonlz4 (modified 2 minutes before the crash), previous.jsonlz4 (modified yesterday), and upgrade.jsonlz4-2025-11-10. To get your work back, you select recovery.jsonlz4, copy it to the main profile directory, and rename it to sessionstore.jsonlz4. Upon launching the browser, the 20 tabs are restored exactly as they were 2 minutes prior to the system failure.
If the recovery file had also been corrupted, you would repeat this process with previous.jsonlz4. While you would lose the tabs opened today, you would successfully recover the state of the browser from the previous day's session.