You may not have seen this on Firefox 4.0 or above which is a useful feature, so that you may save a browsing session for later, or also it will stop accidently closing Firefox and loosing all your open tabs.
To Activate “Save Tabs and Quit” feature in Firefox 4 or above
1. Open a new tab and type “about:config” (with out quotes, and press enter
2. Click “I’ll be careful, I promise” Button
3. In the Filter textbox type “quitwarning“ with out quotes
4. It will show a Boolean value named “browser.showQuitWarning”
5. Change the value of that variable to true by double clicking on it
Close the tab, that’s all you have done. Now onwards Firefox will tell you to confirm how you want to quit, With saving browsing session or with out saving.