How to Unclobber your Last Session in Google Chrome

Update, June 24th

It occurred to me that it is possible some of you may be reading this post in the hopes of discovering how to configure Chrome to automatically resume your previous session. Fortunately, that’s easy! Simply click on Configure (that’s the wrench icon in the upper right), then click on “options” and make certain that “reopen the pages that were open last” is selected under on startup in the “basics” configuration category.

The crux of this post doesn’t address what I have highlighted here; instead, it assumes that your browser is already resuming the last open session. Furthermore, the solution offered here 1) presumes that your typical use case includes having more than one browser window open with multiple tabs each and 2) is intended to recover your last session after you have inadvertently clobbered it, either by opening only one (1) window from your previous session–and then promptly closing it–or by closing so many tabs that Chrome’s new tab session selection no longer shows your previous windows.

I should also mention that this solution may or may not work for those of you who do not have Chrome configured to reopen your last session. There is a possibility that this fix works only in the circumstance that you do.

Unclobbering your Session

I’ve been using Chrome for quite some time because it’s markedly faster than Firefox. I still use Firefox regularly, but my tab addiction doesn’t seem to play nicely anymore with any browser I use. Unfortunately, there’s one glaring shortcoming with Chrome’s UI that drives me nuts: If you have dozens of tabs spread out across two or three Windows, you can recover your last session from Chrome’s default empty tab UI if and only if you haven’t recently closed enough new tabs that would otherwise overwrite your session history. Worse, extensions like FreshStart don’t always recover your previous browsing state–in fact, I’ve had very poor luck with FreshStart displaying empty sessions or not remembering all of my open windows! So what do you do?

Before you think “Crap, I just lost 200 tabs” and close Chrome again, don’t. Do copy Chrome’s user data (%APPDATA%/Local/Google/Chrome (Windows), ~/.config/chromium/Default (Chromium, Linux), ~/.config/google-chrome/Default/ (Chrome, Linux–thanks to Joe in the comments)) to a safe location before closing Chrome a second time. Or, optionally, copy Last Session and Last Tabs from %APPDATA%/Local/Google/Chrome to a safe location. Close Chrome once you’ve finished copying the appropriate files; if Windows complains that it can’t copy Current Session and Current Tabs, ignore it. We’ll be replacing these later. If you’ve already closed Chrome, be absolutely certain that you copy these files before you restart the browser. Upon restart, Chrome will wipe any and all chances you have to recover from this accident.

Next, examine the contents of %APPDATA%/Local/Google/Chrome/User Data/Default. Delete or rename the files Current Tabs and Current Session. Then, copy the Last Session and Last Tabs from the backup(s) you made, and rename those to Current Session and Current Tabs, but be mindful of the timestamps. They should match the date and time you last closed Chrome.

Restart Chrome, and it will magically be delivered back to the state it was in before you clobbered your previous session! The trick here, of course, is to not close Chrome a second time once you’ve realized your folly. Doing so will overwrite your previous session, giving you nothing to recover.

If you’re a taboholic like me, this will help you recover what you’ve lost, and it should work for most incidentals! If not, post here with your problems or offer your own unique solutions.

***

38 Responses to “How to Unclobber your Last Session in Google Chrome”

  • Peter writes:

    This doesn’t work for me.
    I copied my Last Session & Last Tabs files and they’re 322 kB & 204 kB but when I copy them and renaming them to Current Session & Current Tabs, Google just opens up the startpage.

  • Benjamin writes:

    This solution (to unclobber Chrome) assumes that you have Chrome configured to resume your session. If you do, continue reading; if you’re not sure, scroll down until you find a bold heading.


    First, did you close Chrome before copying Last Session and Last Tabs? If you did, it’s likely that your tabs were overwritten and cannot be recovered without digging through the history. Although, you should be able to copy over Current Session and Current Tabs in most cases after you’ve closed Chrome and it will still work.

    Here’s what I tried in effort to duplicate your situation:

    1) Close 3 Chrome windows with ~50 tabs each.
    2) Restart Chrome loading only one window (i.e., not resuming the remaining 2 windows from the session).
    3) Close that window.
    4) Copied Last Session and Last Tabs over Current Session and Current Tabs, respectfully.
    5) Restarted Chrome.

    If instead you were to restart Chrome immediately after step #3, the browser will clobber your last session. At this point, the only option you may be left with is to open your history and try to locate the lost tabs.

    Please accept my apologies if this suggestion did not work. It really should, and I am puzzled that it did not, if you have Chrome configured to resume your previous session. If you don’t or you’re not sure, keep reading.


    This solution will not work (or will appear not to work) if you haven’t instructed Chrome to resume your last session:

    If you’re not sure whether or not Chrome is configured to resume your last session, verify that you have the following set: Click configure (the wrench icon) > Options > “Reopen the pages that were open last” (under “Basics”) selected. I’ve made this mistake before!

  • megan writes:

    does this also work for mac? i just lost 3 windows with several tabs in each. thanks!

  • Benjamin writes:

    I don’t see why not.

    I only use Windows and Linux, but from what I can find, the appropriate files should be located under $HOME/Library/Application Support/Google/Chrome/Default. Browse to there and follow the instructions as with Windows but make sure to back up the folder first (just in case).

  • Arthur writes:

    Hey, Benjamin!

    Great post and very helpful! Here’s a more specific case (me):

    Cleaned the registry files and redundant files on the computer (2,24GB) with CCleaner.
    Haven’t noticed the Applications tab, where I could have said to keep the last session and history from Chrome… so I “deleted” them… all :D (yup, including History :P )

    Then, heard about Active Undelete, got it and wondered HOW I can get back the lost session, USING this program… (scanned C:\ and saw that Last Session is “recoverable”)

    So:
    1. Do I have to get back ALL the Google folder? (700 MB)
    2. Do I copy/recover it on D:\ ?
    3. HOW do I make use of the last session file? (oh, u answered that one…)

    3.5. Does your method work if I have the Last session file, without Last Tabs?

    I’ll go tomorrow on that computer and see if I can recover Last Tabs, too.

    Thank you very, VERY much for this article and for a response.

    I only had like 30 tabs open, but they had important information…

    I was beginning to think I’m the only Tab freak , or taboholic as you said :D

  • Benjamin writes:

    1) No, you shouldn’t have to. I suggest it, because it’s probably the easier way to guarantee that you’ve got a backup of the session data (and user preferences). I should probably correct that in the post, because it seems confusing when I re-read it.

    Ultimately, you really only need to copy Last Session and Last Tabs, if they’re still recoverable, before restarting Chrome (again). Otherwise, Chrome will clobber them.

    If Current Session and Current Tabs are listed as recoverable, you might try restoring them. That’s tricky, because it depends on the state Chrome was in when they got zapped.

    2) Depends on what your D: drive is. If it’s just a partition where you can temporarily store files, I’d make use of it since it affords a little extra protection that you won’t accidentally trash something you intended to keep. Also, it doesn’t hurt to keep a backup of Chrome’s user data for your account, but as you noticed–it gets big!

    3) Yeah, just remove Current Session and Current Tabs, replacing them with Last Session and Last Tabs. Make sure to renamed Last Session to Current Session and Last Tabs to Current Tabs, probably before you restart Chrome.

    3.5) I'm not sure, I haven't tried that. I'd imagine that it should have your session data for that session (browsing history, mostly), but the tabs will be gone if that file has been permanently removed or is unrecoverable. However, you should be able to retrieve what you wanted from the browsing history.

    I'm definitely a taboholic. Back in the days prior to Firefox 3.x, I usually had ~500 tabs open. When Mozilla released Firefox 3, it seemed quite happy to freeze and/or crash ~250 tabs.

    Nowadays, I generally have Firefox and Chrome open for various things (usually documentation-related, but not always), and several windows open for Chrome. I've noticed the latter doesn't gracefully handle a gazillion tabs, but it's still doable.

    Hope this helps! If you still can't quite get it working, just drop a line. I really should rewrite the article to be more specific...

  • Mike writes:

    Thank you very much. 88 windows, 417 tabs recovered. :) Chrome and my system have been extremely stable for me, haven’t had an issue like that before! A particular chrome window started flashing on the taskbar like it had a dialog box open that was requiring input, like OK/cancel, but there was none. Could switch to other chrome windows and interact with currently displayed webpage, but couldn’t change tabs/close tabs/open sessionbudy/open chrome task manager or options/etc.

  • Benjamin writes:

    Good to hear this was useful!

    I’ve noticed that increasingly Chrome seems to have a tendency toward mysteriously destroying open tabs, particularly when spread across multiple windows. This happens both under Windows and Linux. Although your window manager urgent hint issue is strange.

    I’d suggest keeping periodic backups of your Last Session and Last Tabs files, although I’m really terrible at following my own advice. :)

  • Tom writes:

    Twice I’ve come across this post panic-Googling after inexplicably failed reopenings now, and neither time has it worked – I just get a blank new window. Both times, while the “Last Tabs” file appears to have been a normal size, “Last Session” has only been 1 KB. Do you have any idea what the problem is here, and whether I can force a restoration using the last tabs without the last session?

  • Adtc writes:

    “but be mindful of the timestamps. They should match the date and time you last closed Chrome.”
    What do you mean by this? How do I make sure they match?

    I have tried to restore last session but it failed, only showing a “Recently closed” option on the home page. The pages that I want to restore are lost, and the option is only showing pages I don’t want to restore.

  • Miral writes:

    Thanks for posting this, it just got me out of a jam. :)

    Unfortunately I had just foolishly closed Chrome for the second time (following some other recovery instructions that didn’t work). But I was able to use Windows’ Restore Previous Versions feature to recover a copy of my Last Session/Tabs files from last week (my last restore point). This means I’ve probably missed a few tabs but nothing too serious, and the vast majority of my tabs are back again safe and sound. So thanks for the hint!

  • Benjamin writes:

    @Tom

    Twice I’ve come across this post panic-Googling after inexplicably failed reopenings now, and neither time has it worked – I just get a blank new window. Both times, while the “Last Tabs” file appears to have been a normal size, “Last Session” has only been 1 KB. Do you have any idea what the problem is here, and whether I can force a restoration using the last tabs without the last session?

    No, it seems that your session has been clobbered for good. The important thing to remember is that once your session is clobbered do not close or re-open the browser until you’ve recovered your “Last Session” and “Last Tabs” files. If they’re 1KiB, they’ve been trashed by too many panicked open/close cycles.

    The only thing you can do at this point is to go through your browsing history and recover what you want from there and make a note to be more careful in the future. (Yes, that’s not what you want to hear, but I know of no other way to fix it.)

    @Adtc

    “but be mindful of the timestamps. They should match the date and time you last closed Chrome.”
    What do you mean by this? How do I make sure they match?

    Look at the last modification date of those files from your file browser (Explorer in Windows, not sure what OS X prefers, or whatever your preferences are under *nix platforms). It should line up with the approximate time you closed your browser since that’s when the session data is saved.

    I have tried to restore last session but it failed, only showing a “Recently closed” option on the home page. The pages that I want to restore are lost, and the option is only showing pages I don’t want to restore.

    If you’ve mucked up your last session, you have to copy both “Last Session” and “Last Tabs” to a safe location, close Chrome, then delete or rename them to “Current Session” and “Current Tabs,” respectively, and restart Chrome. If you don’t copy both, your tab list won’t be completely recovered. Also, see what I wrote in reply to @Tom (above); if you open/close your browser, it will replace the only backup copy of your session and tabs with a blank one.

    @Miral

    Good to hear it worked!

    But I was able to use Windows’ Restore Previous Versions feature to recover a copy of my Last Session/Tabs files from last week (my last restore point)

    I hadn’t thought about this, but this is another really good suggestion. As browsers become increasingly more important for webapps and the likes, keeping copies of our tabs becomes equally more important!

    Your suggestion would probably work for LVM snapshots (or ZFS, etc.) as well. It’s a really good idea.

    Thanks for sharing!

  • Tom writes:

    I don’t close and re-open the browser after the first failure to reload tabs, though – I wasn’t talking about one session I’ve tried to reload repeatedly, but different sessions months apart, where both times I followed these instructions before re-opening Chrome. I always set out to get the tabs back the moment it’s failed to reload anything (it’s become a recurring problem since I last commented), but it never works! It seems I just get permanently “clobbered” straight away (I’m not sure what exactly that means but I’ll go with it). Currently, my only work-around is “going outside and getting some fresh air”, which will probably do me good in the long run.

  • Benjamin writes:

    I always set out to get the tabs back the moment it’s failed to reload anything (it’s become a recurring problem since I last commented), but it never works! It seems I just get permanently “clobbered” straight away (I’m not sure what exactly that means but I’ll go with it).

    The other possibility is that you have Chrome sync enabled, and it’s somehow overriding your tabs. You may need to check whether that’s the case or not (wrench icon -> settings -> settings -> examine the state of the “sign in” section). Also, make certain that the “start up” option is set to “continue where I left off.”

    These are settings for Chrome 20.* and higher.

    Otherwise, you may be encountering a bug. If that’s the case, you may need to move your “User Data” directory out of the way (with Chrome closed, of course), start Chrome, reconfigure it to your liking, and then see if it saves your tabs.

    But again, be sure that it’s configured to remember your tabs from the last session.

  • John writes:

    I use Ubuntu 12.04 and the Chrome history files are in: ~/.config/google-chrome/Default

  • John writes:

    Unfortunately that didn’t work as the problem – that Chrome doesn’t restore the previous session – seems to occur when Last Session and Last Tabs are empty.

  • anon writes:

    That was very helpful, thanks for sharing!

  • Benjamin writes:

    @John

    I use Ubuntu 12.04 and the Chrome history files are in: ~/.config/google-chrome/Default

    I originally wrote this under Windows; I now use Arch Linux exclusively but don’t use Chrome regularly. Updated.

    Unfortunately that didn’t work as the problem – that Chrome doesn’t restore the previous session – seems to occur when Last Session and Last Tabs are empty.

    The Last (Session|Tabs) files are what contain your session information for restoration the next time you load Chrome/Chromium. Check that “Settings -> On Start Up -> Continue where I left off” is selected. If it isn’t, this trick is useless because it’s only intended to restore a session where you have session restore enabled but you’ve recently done something to clobber it.

    I use Firefox now mostly because Chromium has exhibited some very frustrating bugs related to session restoration. Restoring multiple windows often doesn’t work, but it seems to consistently restore a single window–if you don’t clobber that session.

  • Andrew writes:

    Nice. It worked for me!

  • A writes:

    If this doesnt work for you try this solution at stackoverflow:
    http://superuser.com/a/341138/142837

  • Benjamin writes:

    @A The solution you linked to on superuser.com is exactly what I’ve illustrated above. Did you mean to link to something else?

  • Joe writes:

    Your linux instructions are for Chromium — not Chrome. It looks like my chrome session is stored in ~/.config/google-chrome/Default/.

  • Benjamin writes:

    I’ll update the article accordingly. Thanks. (Note: I only use Chromium, so I admit there’s some degree of bias.)

  • Alex writes:

    Thank you so much!! It worked! I had bsod and the restore tab didn’t come up…

  • J writes:

    Benjamin, thanks very much for the walk-through. Unfortunately all it did for me is confirm that my 37 fairly crucial tabs are gone.

    “Silly” me for assuming that ‘Recent’ referred to time and/or number of tabs closed, and not number of app close/opens. Urrrgh.

    I can also confirm, for anyone reading, that Apple’s ‘Versions’ does not retain versions of Last or Current Tabs files.

    Deep breaths. Deeeeeeeep.

  • Benjamin writes:

    You might still be able to check your history for the closed tabs. It’ll take more time to trudge through the entirety of the list, but all is not lost!

  • J writes:

    Yeah, those deep breaths were preparation for that. Laptop had been running for over a month, so remembering which of the hundreds (thousands?) of tabs I’d viewed were the active ones was a fairly massive task. Think I recovered about 80% in the end.

    Let this be a lesson, blah blah blah :)

  • Benjamin writes:

    Oh dear!

    Since I originally wrote this post, I’ve more or less relegated Chromium/Chrome to generic browsing. Anything important goes in one of several Firefox instances backed with SessionManager in the event something untoward happens. Nevertheless, it’s still incredibly frustrating when Chrome does something stupid.

    Perhaps writing a bash script or something and stuffing it into cron, backing up the Current.* files periodically might not be such a bad idea these days? I don’t know a sufficient amount about Chrome’s internals to give direction outside the recovery steps listed here, but I’m sure searching around might yield better information indicating whether it’s possible (or advisable) to copy the current tabs, or how one might be able to automatically derive the last visit times (or active) status of tabs in its history.

    Not to bash on Chrome, but one thing I really like about Firefox is the potential for running an isolated instance (or instances) from the profile manager. I do this with generic browsing, documentation, and development instances–the latter so I don’t mess up anything important and the former two so I don’t have to separate random browsing from docs. :)

  • aadsfasdfsdaf writes:

    Got this to work after a little bit of fiddling. You’re an absolute lifesaver and I will love you forever.

  • Dread Knight writes:

    Lost 300 tabs, really disappointed…

  • Benjamin writes:

    @Dread Knight Sorry to hear that. Unfortunately, your comment doesn’t indicate whether or not you tried to recover your tabs or what recovery options you attempted.

    Complaining here generically about losing tabs is pointless. I’m not in any way affiliated with Chrome/Chromium development. You’d have better luck directing your disappointment to Google’s product forums.

  • Daniel writes:

    Hi there,

    I have successfully used this procedure to recover my session/tabs. Today however and despite having a hefty MB range Tabs and Session Files backed up, Chrome immediately comes up with a NEW current session file destroying my overwritten copy. Any ideas on what is happening? I seriously need to look into these suggestions, it’s the third time this happens and it consumes my soul every time.

    Thanks

  • Daniel writes:

    (update)

    Apparently my (Last) Current Session file is 1.5Mb of blank space. The file starts with “SNSS” then blank all the way. I guess that file is gone, and with it my chances of recovery. Fkn Chrome…

  • Benjamin writes:

    @Daniel

    “SNSS” is the “magic number” indicating the type of the file. You can probably read more about it here, but being as Chromium uses it as well (and is the open source base project for Chrome), the sources will likely document the format better.

    Sadly, I have no idea why your sessions are repeatedly being removed. The only suggestion I have is to completely wipe your Chrome profile (or move it out of the way) and if you have backups of your tabs and sessions, copy them into the new profile once it’s created.

    For important work, I use Firefox + Session Manager. It’s not absolutely fool proof, but you’re much less likely to lose a large number of tabs.

  • David J Gill writes:

    Is “unclobber” an actual term. I can’t find any reference to it.

  • Wayne writes:

    We really need to pressure the Google developers in charge of Chrome to become competent. They need only research how people use tabs for about 10 minutes to realize that never losing them is very important to use… I’ve emailed 10 Chrome developers last week – with no replies so far. Please help me put pressure on them to do their jobs.
    Thanks – let us not lose anymore data.

  • Benjamin writes:

    To be clear, I don’t see this as a particularly serious issue that requires pressuring anyone to “fix” it. At worst, it’s annoying, but there are now tools available to mitigate the likelihood of losing your session like Session Buddy (this is not an endorsement; I don’t use Session Buddy, nor do I use Chrome very often).

    What I’ve posted here is a workaround in the hopes it might be useful to some, but I patently refuse to involve myself in spats with their developers. Honestly, in my experience, large numbers of tabs are best managed with Firefox + Session Manager. Save Chrome for pages that don’t work well under Firefox or performance-sensitive tasks.

    Now, should Chrome have a built-in session manager that prevents loss of tabs? Probably. Are there extensions available that let you do roughly the same thing? Yes.

Leave a comment

Valid tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>