A relatively recent Firefox update, I think maybe 2.0 when it came out, added a clever new feature. It saves a running log of your session so that, if Firefox crashes, the session can be restored as if it was working all along.
(Normally I’d gripe about Firefox crashing at all, but since it runs third-party code in the form of plug-ins, I suppose there’s not all that much the Mozilla Foundation can do about it. Being a Mac user from the Classic era, and remembering the horror of Extensions, I’m particularly forgiving on this front. The session restoring is better than nothing.)
The problem is what Firefox thinks an “interrupted session” is. Specifically, if Firefox is running and I log out, restart, or shut down, Firefox, the next time I start it up I’m presented with the annoying dialog box from hell: “Your last Firefox session closed unexpectedly:”
No, Firefox. It didn’t close unexpectedly. I chose “Log Out” from the goddamned menu, and I expected it to close. How else could I log out if my applications didn’t close? Der.
This presents two different possibilities, listed in order from kind of stupid to completely stupid:
- The Mozilla Foundation believes that Firefox users are so stupid they won’t realize that the OS will have to close Firefox to restart.
- The Mozilla Foundation is so stupid that they don’t realize that the OS will have to close Firefox to restart.
So what does Google have to do with this? Well, they’ve introduced a new plug-in for Firefox called Google Browser Sync which, well, it does pretty much what the name implies it does: it syncs all browser settings between multiple computers. It also, lo and behold, has a feature where it can save your session and restore it, much like Firefox’s built-in feature that does the same thing.
The only difference is what Google considers an interrupted session: Any time Firefox is closed, for any reason, your session is interrupted. Were you finished browsing? Doesn’t matter, if you close Firefox, your session was interrupted and Google Browser Sync will “helpfully” ask if you want to restore it.
Firefox’s definition of “interrupted session” is stupid. The OS telling Firefox to quit isn’t an “interrupted session” no matter how you look at it. But Google’s definition is beyond stupid, I’m afraid. My only question to the developers of Google Browser Sync: How do I end my Firefox session without interrupting it? Do you have to go back to your homepage before closing it? Or maybe go to “about:blank”? Whatever it is, please tell me.
Well, it’s only a matter of time before a Google executive finishes setting up their projector for the high-roller tech demo, opens up his copy of Firefox and sees this:
And the feature will be gone forever.


jp10558 | 28-Jan-08 at 10:38 am | Permalink
I think you are missing a critical bit of info with the Firefox built in mechanism. I use Opera, but see this often on the Opera forums.
Specifically:
What does it mean when you log out/restart from the OS level. It’s generally a bad idea to use the OS to shut down applications en masse, because it leads to issues like this. And here’s why:
On windows, it sends a termination signal to the application. If the app isn’t fast enough, it kills it. When an application is terminated with either method, it’s a message to *CLOSE RIGHT NOW*. This means lots of housekeeping that would get done in a normal app exit is not done, instead the app trys to exit immediately. If it gets killed, the OS just forcably unloads it from memory. From an application perspective, this is the same as you hitting the power switch on your PC.
So - Firefox and Opera don’t actually see much difference there between a crash or power outage and Windows killing the app so you can logout.
Now, some of this is related to how firefox responds to a termination signal (shouldn’t crash close there really) and some is going to be related to users/windows - do you want to let windows wait for the full app exit time (maybe several minutes?) or will you click end task on that pop-up from Windows?
Maybe apps shouldn’t do so much housekeeping on closing (like deleting cache, writing state to ini files etc), but then they either lose features like the empty cache on exit, or slow down while running so they do the work incrementally while you’re using it, or fail to keep state between runs.
I’m not sure there is an obvious solution here - but the best idea is to cleanly exit your apps prior to shutting down your system.
blakeyrat | 28-Jan-08 at 10:46 am | Permalink
Thanks for the comment.
The problem is twofold:
1) I’ve been shutting down apps by logging out of Windows and letting it do the dirty work for a decade now, and it’s never been a problem for any application, ever, before. I don’t know why it’s suddenly cropping up as a problem for Firefox, why Firefox can’t tell the difference when all those other applications could for years on end.
2) Windows gives each application about 15 seconds to clean up and exit when you choose the restart option. Older versions of Windows would actually wait for all apps to respond, or they’d end up hung with the “application X is not responding” dialog and never get around to rebooting. (I think 95 and 98 did that. 2000 kills them, IIRC.)
Now my big problem with Firefox is a bug where it didn’t correctly set itself as the default browser in Vista, and every time you click a web link in an application you get an annoying dialog that says Firefox couldn’t be started, right before Firefox starts and shows the page correctly.
Allan Olesen | 10-May-08 at 2:00 am | Permalink
@ jp10558:
An application of this type MUST be able exit gracefully when the OS asks it to shut down. Don’t blame the user for using the facilities of the OS. Especially not when it works for any other program.
Of course, in some cases the application can have unsaved data which cannot be saved without user intervention. In this case, a clean exit is not always possible. But since Firefox never asks for any user intervention during a normal shutdown of Firefox, this is not the case here.
This issue has annoyed me for a very long time too.
@ blakeyrat:
Why do you think that the Google tool is only aimed at unintended shutdowns?. The built-in Firefox function clearly says so, but I don’t see the Google tool saying it. Perhaps it is simply aimed at users who want to be able to continue from where they were when they last (deliberately) closed down Firefox.
blakeyrat | 10-May-08 at 9:50 am | Permalink
Thanks for the comment, Allan.
I know the Google tool is aimed at preserving your Firefox “session” when you switch to another computer, the problem I have with it is that I still don’t know what constitutes a “session.”
For example, if I have 50 tabs open in three windows on my desktop, and I go over to my laptop, Google Browser Sync will ask me if I want to open those same 50 tabs in those same 3 windows like on my desktop. That’s fine, and expected, and desired.
But now I’m reading those tabs, closing them as I do. I’m down to a single tab, with a single page, and I finish reading it and I close Firefox on my desktop. Next time I go to my laptop, it’ll ask me if I want to open that last page.
Why? It’s obvious from my behavior on the desktop that I was done browsing, closing the Firefox window indicates that. The Google Browser Sync plug-in should be able to ‘common-sense’ this scenario, especially since even Firefox’s own over-zealous session definition doesn’t count that as an interrupted session.