Søg i Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox keeps reopening closed tabs on restart

  • 14 svar
  • 1 har dette problem
  • 1 visning
  • Seneste svar af IvanKovalev

more options

Firefox restores any previously closed tab on restart. Windows10, Firefox 78.0.2 What setting does that and what could be a possible reason for changing it from default? Thank you.

Firefox restores any previously closed tab on restart. Windows10, Firefox 78.0.2 What setting does that and what could be a possible reason for changing it from default? Thank you.

Alle svar (14)

more options

Do you mean each time you close and restart Firefox or only when you boot the computer ?


You can check for problems with the sessionstore.jsonlz4 file in the Firefox profile folder that stores session data.

  • delete sessionstore.jsonlz4 and sessionstore.js

When sessionstore.jsonlz4 is deleted you lose pinned tabs and open tabs and you will have to recreate them, so if necessary make a note or bookmark them.
sessionstore.jsonlz4 is only present in the Firefox profile folder when Firefox is closed.

You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.

more options

I did see this suggestion before.

Problem #1 : I do not see sessionstore.jsonlz4 and/or sessionstore.js files at all. The only thing that shows up is sessionstore-backups folder .

Problem #2: Even if those files were there and I could remove all tabs by deleting those files, I do not see how it would address the root cause . Firefox is reopening on restart all tabs that were ever opened before, does not matter if it was closed before restart or not.

I am looking for solution for this and expect that it should be something with settings.

more options

Could you confirm you don't have this set on the Options/Preferences page:

Note: If you use a URL in your reply, such as quoting that embedded image, your post may be diverted to the spam moderation queue rather than appearing immediately.


Another possible reason Firefox might restore your previous session at startup is if there is a "restore once" command in an optional user.js file. There's a section of the following article on tracking down a possible user.js file -- unless you created it yourself, you probably don't need it:

How to fix preferences that won't save

Note: don't double-click Firefox's .js files because Windows will execute them as system scripts. While they are unlikely to do any harm, that cannot be guaranteed. Instead, right-click > Edit the files to view their code.

more options

The sessionstore.jsonlz4 is only present in the profile folder when Firefox is closed.

more options

I do have "Restore previous session" checked because I do want it to reopen the tabs, but only those that I kept open at the time of restart, when Firefox was going down. I did not touch users.js .

Once again. The problem is not that Firefox restores session, but it does it incorrectly. It does not remember the state and reopens the tabs that were closed before restart.

more options

If you do not get the tabs from the previous session then this is usually an indication that sessionstore.jsonlz4 or files in the sessionstore-backups folder are corrupted and aren't updated for other reason and Firefox is opening an older copy of the sessionstore file.
That If why i wrote above that you can try to rename/remove sessionstore.jsonlz4 in the Firefox profile folder with Firefox closed. For very persistent issues you may also have to rename/remove the sessionstore-backups folder that is used during a session to store session data.

You can use the button on the "Help -> Troubleshooting Information" (about:support) page to go to the current Firefox profile folder or use the about:profiles page.

more options

I did check for sessionstore.jsonlz4 having Firefox closed. Not there.

Another update: The issue seems to be intermittent. This is happening on my wife's PC, I verified it yesterday. Today she reported that closing several tabs and restarting was a success.

more options

IvanKovalev said

I do have "Restore previous session" checked because I do want it to reopen the tabs, but only those that I kept open at the time of restart, when Firefox was going down.

Okay, it wasn't clear to me before that you wanted anything restored.

When everything is working correctly, Firefox updates the

recovery.jsonlz4

file as often as every 15 seconds to reflect changes in open/closed tabs, open/closed windows, and new pages loaded in each tab. As a backup, Firefox also updates the

recovery.baklz4

file on the next round (it show what recovery.jsonlz4 had an an earlier time).

If you are getting different tabs at startup, perhaps Firefox stopped updating one or both of those files at some point. However, this is something you would need to check before closing Firefox, by consulting the last modified time on those files.

You can open your current Firefox settings (AKA Firefox profile) folder using either

  • "3-bar" menu button > "?" Help > Troubleshooting Information
  • (menu bar) Help > Troubleshooting Information
  • type or paste about:support in the address bar and press Enter

In the first table on the page, find the Profile Folder row and click the "Open Folder" button.

In your profile folder, double-click into the sessionstore-backups folder. If necessary, switch File Explorer to the "Details" view that shows the last modified date/time. (Example screenshot attached.)

Is recovery.jsonlz4 up-to-date?

more options

You can use one of these to close Firefox if you are currently doing that by clicking the close X on the Firefox Title bar.

  • "3-bar" menu button -> Exit (Power button)
  • Windows: File -> Exit
  • Mac: Firefox -> Quit Firefox
  • Linux: File -> Quit
more options

About recovery.* files in sessionstore-backups folder: they have the same time , matching time of last restart.

more options

The files aren't updating as you use Firefox? That would miss out all your changes during your session and roll you back to your current starting position at the next startup. Is that happening?

more options

These files might be updated during session, I am not sure what triggers it. Right now recovery.jsonlz4 is 10 minutes newer than *.backlz4 one. Both within current session. Test close tab without closing session did not affect them.

more options

What is your update interval:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box in the page, type or paste sess and pause while the list is filtered

The browser.sessionstore.interval preference determines how quickly the files are updated. By default, this is 15 seconds, written as 15000 milliseconds. Has yours been altered? If so, a reset button (arched left pointing arrow) will appear at the right end of the row.

more options

Interval was not altered, still reads 15000. ( Out of all *sess* values in config only one was updated, upgradeBackup.latestBuildID.). I tested open new tab on my PC (recovery.* files were updated) and on the problem, my wife's PC - recovery.* files there were not updated. They keep start of the session time stamp, 1 minute apart from each other. It looks like this behavior not keeping update interval is intermittent, because sometimes the list of open tabs does change.