Firefox keeps logging you out after every restart? The cause is almost always cookies being cleared at exit, an extension scrubbing them on tab close, or strict tracking protection breaking the session.
This walkthrough covers each fix in order. You'll start with the cookie-on-close toggle, then check the History wipe, cookie exceptions, tracking protection, extensions, Sync, and a profile refresh. Most readers only need the first one or two fixes.
In this guide, I have covered:
Contents
Why Firefox keeps logging you out of websites
Firefox keeps logging you out because the cookie that proves you signed in is gone. To a website, each visit without that cookie looks like a brand new browser.
The cookie usually disappears for one of three reasons: Firefox deletes it on exit, an extension scrubs it when the tab closes, or strict tracking protection breaks the session.
This page starts with the most common cause and works outward. Stop when the logout problem stops. Mozilla’s Firefox support forum has more user discussion if your setup is unusual.
Stop Firefox from deleting cookies when it closes
If Firefox logs you out only after you close the browser, the cookie-on-close setting is usually to blame. The Delete cookies and site data when Firefox is closed toggle destroys every session cookie at shutdown. Sites treat you as a stranger the next time Firefox opens.
- Click the hamburger menu
at the top right of Firefox and choose Settings. - Select Privacy & Security from the left sidebar.
- Under History, change Firefox will to Remember history if it is not already selected.
- If you use custom settings, untick Clear history when Firefox closes.
- Click Settings… next to it and untick Cookies in the popup list.
- Restart Firefox once for the change to take effect.
Sign into the site, close Firefox, and reopen it. If you stay signed in across restarts, stop here. If you also want to clear cached files to free space, see the guide to clear cookies and cache in Firefox.
Stop the on-shutdown history wipe from clearing your sessions
If you still lose sessions after turning that off, Firefox’s History panel may be clearing cookies on exit anyway. Most people miss this path because it sits in a different part of Settings.
- Open the hamburger menu
at the top right of the browser and click Settings. - Pick Privacy & Security from the left sidebar of Settings.
- Scroll to the History section. Make sure the dropdown at the top is set to Use custom settings for history.
- Uncheck Clear history when Firefox is closed. If you want to keep clearing other things on exit, click Settings… next to that checkbox and uncheck Cookies and Site Settings, leaving browsing history and cache checked if you still want those wiped. The Site Settings box in particular wipes cookie exceptions, which is what forces a logout on every restart.
- Close the Settings tab. Sign into one of the affected sites, close Firefox, and reopen it to confirm the session survives a restart.
If the History dropdown is set to Never remember history instead of Use custom settings for history, Firefox behaves like a permanent private window and logs you out every time you close the tab. Change the dropdown to Remember history first, then follow the steps above.
Add the affected site to Firefox’s cookie exceptions
If you want to keep the global cleanup on but stay signed into a few sites, add those sites as exceptions. Exceptions take priority over the delete-on-close setting.
- Open the hamburger menu
and choose Settings. - Click Privacy & Security in the left sidebar.
- Scroll to the Logins and Passwords section.
- Click Exceptions to see the full list of skipped sites.
- Search the list for the site whose password seems to be missing.
- Select the entry and click Remove Website to allow Firefox to save logins for it again.
In the exception dialog, type the site’s address under Address of website, set the dropdown to Allow, and click Save Changes. Sign in once after that. Firefox will keep that cookie across restarts even while the global clear setting stays on.
Turn off Enhanced Tracking Protection for the affected site
If only one or two sites log you out, Enhanced Tracking Protection may be interfering with their login widgets. Firefox defaults to Standard, which includes Total Cookie Protection. Sites that use a Sign in with Google button or an embedded login iframe sometimes fail to recognize your session under that mode.
- Open the website that fails to load in Firefox.
- Click the shield icon to the left of the address bar.
- Toggle the switch labeled "Enhanced Tracking Protection is ON for this site" so it moves to OFF.
- Wait for Firefox to reload the tab automatically, then try the page again.
Reload the site and sign in. Close and reopen Firefox later to confirm the session sticks.
TIP: If the logout happens only on one or two sites, click the shield icon in the address bar and turn off protection for that site right from the page.
Disable cookie-clearing or privacy extensions
If you installed a privacy or cookie extension, that may be the culprit. Extensions like Cookie AutoDelete and Privacy Badger can delete cookies on tab close, after a timeout, or at shutdown.
- Click the hamburger menu
and select . - In the left sidebar, click .
- Use the blue toggle next to each extension to disable it. Start with ad blockers, tab managers, and any extension you installed in the past few weeks.
- Restart Firefox from the hamburger menu
. - Use Firefox normally for a few minutes, then check about:performance. If usage dropped sharply, re-enable extensions one by one to find the offender.
If you want to keep using a cookie extension after this test, most have a per-site allowlist. Add the sites you stay logged into to that allowlist and re-enable the extension.
Confirm Firefox Sync isn’t sending a stale session to another device
If you use Firefox Sync, a second device can overwrite a fresh session with an older one. Confirm what is syncing before changing anything else.
- Open the hamburger menu
and choose Settings. - Click Sync in the left sidebar, or click the Mozilla account icon at the top right of the page.
- Sign in to your Mozilla account if you are not already signed in.
- Click Manage Sync to see the categories being shared.
- Make sure the Logins toggle is turned on.
- Click Sync Now to pull the latest saved logins from the cloud.
After you confirm logins are syncing, sign into the site on each device you use and let the session settle for a few minutes before closing. For a broader look at what Firefox keeps on disk per site, the Firefox cache and storage guide shows how to inspect that data.
Reset Firefox as a last resort
If Firefox still logs you out after every other fix, a damaged profile may be the cause. The Refresh feature keeps your bookmarks and saved passwords but resets preferences, add-ons, and startup settings to defaults. It follows the same path as resetting Firefox browser settings on the computer.
- Click the hamburger menu
, choose , then select . - On the Troubleshooting Information page, find the Give Firefox a Tune Up section on the right.
- Click Refresh Firefox and confirm by clicking in the dialog.
- Wait for Firefox to restart. Your bookmarks and logins are preserved, but extensions and most site settings are reset.
After the refresh, sign into the sites you care about once, restart Firefox, and confirm they remember you. If you also want to clear browsing history as part of cleanup, the clear Firefox browsing history guide covers the same settings panel from another angle.
Frequently Asked Questions
Why does Firefox log me out of every site after I close it?
The most common reason is that Firefox is set to delete cookies when it closes. Open Settings, pick Privacy & Security, and turn off both Delete cookies and site data when Firefox is closed and the Clear history when Firefox is closed checkbox in the History section.
Will turning off cookie clearing compromise my privacy?
It only means cookies live until the site itself expires them or you clear them manually. You can still keep Enhanced Tracking Protection at its default Standard setting, and you can add exceptions for the specific sites you want to stay logged into.
Can Total Cookie Protection cause logouts?
Yes, on sites that use cross-site sign-in widgets or embedded iframes for the session. If the logout only happens on one or two specific sites, turn off Enhanced Tracking Protection for those sites using the shield icon in the address bar.
Can an extension log me out of a website?
Yes. Cookie AutoDelete, Privacy Badger, and similar extensions delete cookies on tab close or after a timeout. Disable any extension that mentions cookies and see whether the logouts stop.
I use Firefox Sync. Could that be logging me out?
Rarely, but if a session syncs before it is stable, the older copy can win. Confirm your Sync settings include logins, and let each device settle for a few minutes after you sign in before closing.
