Safari 15 fails to restore last session. What can I do to fix it?

After installing Safari 15, when I launch it, it will bring up all the windows from the last session, as expected. Unfortunately, every window has only one tab in it, set to the start page. Quitting Safari and restarting it has no effect. When I visit a web site, then quit Safari, it isn't restored when I start Safari again. Basically, the history preserved across a relaunch is 15 empty pages. What can I do to fix this?


iMac Pro, macOS 11.6

Posted on Sep 22, 2021 4:22 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 15, 2022 1:36 PM

This problem really interferes with my work. And it's frustrating to have Search engines come up with the same, "...set it in preferences..." recommendations. "Doesn't Work" is not "How it's supposed to work".


My work-around is, right after launch, immediately go to the History menu and select "Reopen all windows from Last Session" - about the seventh option down.


The fact that Safari KNOWS which windows/tabs were open - because after that selection they are opened - points to it just ignoring the preference. I mean if I can click on a menu option and have the desired action taken - the action that is specified in preferences - then on launch they just need to check if the Open from last session preference is checked and trigger the same action that is tied to that History Menu selection.


I suppose, if you had a Quickkeys type app, you could make a keying sequence that would launch Safari and continue to click History, then "Reopen All Windows from Last Session."


I'm an old guy. Started with a 7094. When I see the code the younger generation is putting out, I have no fear of AI taking over the world.

31 replies
Question marked as Top-ranking reply

Jan 15, 2022 1:36 PM in response to Derek Clegg

This problem really interferes with my work. And it's frustrating to have Search engines come up with the same, "...set it in preferences..." recommendations. "Doesn't Work" is not "How it's supposed to work".


My work-around is, right after launch, immediately go to the History menu and select "Reopen all windows from Last Session" - about the seventh option down.


The fact that Safari KNOWS which windows/tabs were open - because after that selection they are opened - points to it just ignoring the preference. I mean if I can click on a menu option and have the desired action taken - the action that is specified in preferences - then on launch they just need to check if the Open from last session preference is checked and trigger the same action that is tied to that History Menu selection.


I suppose, if you had a Quickkeys type app, you could make a keying sequence that would launch Safari and continue to click History, then "Reopen All Windows from Last Session."


I'm an old guy. Started with a 7094. When I see the code the younger generation is putting out, I have no fear of AI taking over the world.

Oct 22, 2021 6:58 AM in response to Fly_view

Looks like Safari saves the tabs in "/Users/user/Library/Saved Application Sate/com.apple.Safari.savedState" instead (actually that's a symbolic link to "/Users/user/Library/Containers/com.apple.Safari/Data/Library/Saved Application State/com.apple.Safari.savedState".


I was able to restore all my tabs from before updating to Safari 15 by 1) quitting Safari, 2) restoring that directory from the last backup before I updated to Safari 15, 3) making a backup of the restored directory and saving it somewhere safe, 4) restarting Safari and seeing all tabs from the old session.

However, while Safari 15 successfully imported all my tabs from this old backup, it messes them up again upon quitting. So, until the problem gets resolved I guess I'll have to keep restoring from the backup that I made in step 3...

Oct 25, 2021 10:03 PM in response to Caleb Mattoon

THIS. Try this, everyone.


I tried all i could find, from this thread and others. I had the very same problem everybody may be having. Several pages "Untitled" after the update.


  • LastSession.plist doesn't work anymore.
  • ~/Users/[user name]/Library/Containers/com.apple.Safari/Data/Library/Safari and the "SafariTabs.db" files (four of them apparently) didn't exist before Safari 15.


This was what saved me! No scripts, no reinstalling, downgrading. Just substituting the:


"/Users/user/Library/Containers/com.apple.Safari/Data/Library/Saved Application State/com.apple.Safari.savedState"

or (seems to be the same directory, just different paths)

"/Users/user/Library/Saved Application Sate/com.apple.Safari.savedState"


with the files you have (Time Machine in computer, no backup to external disk was made) that were created AND modified before the update.



Thank you so much, Caleb Mattoon.

Mar 7, 2022 3:36 PM in response to Derek Clegg

After migrating from an old laptop running High Sierra to a new laptop with Monterey and Safari 15.3, Safari didn't reopen windows on startup. I could manually re-copy various files from the old laptop before running Safari, and it would open them on launch, but would reopen with each window having only one tab, set to the startup page (in my case, blank). This turned out to be a known issue for some users, as documented in Apple support forum posts, and confirmed by Apple. I found that if I re-copied the files, launched Safari, then went to each window and opened and closed some tabs, then if I quit and re-ran Safari, it would open one of the windows correctly, but none of the others, and would only do it once.


I tried the solution described here, but the specified files didn't exist for me.


I wiped the drive, re-installed Monterey, re-migrated everything from the old machine, but it behaved exactly the same. So I created a Big Sur installer, wiped the drive, installed Big Sur, re-migrated the data, and Safari worked correctly. At one point I OKed a software update, thinking it was updating Big Sur to 11.6.something, but it actually updated Safari to 15.3 (which I wouldn't have OKed if I'd noticed). To my surprise, Safari 15.3 continues to reopen windows on launch. I might try updating to Monterey again, but only after creating a good backup and having some time to redo everything if need be.



Mar 15, 2022 8:30 AM in response to Caleb Mattoon

It appears that Safari 15 loads the ~/Library/Containers/Safari/Data/Library/Safari/SafariTabs.db database (in the terminal it is ~/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.db), but doesn't save tab/window changes to it. If I use Sqlite to make updates to the database and then start Safari, those changes are visible when restoring my last session. If I save a copy, and delete these three files (.db, .db-shm, .db-wal), they are recreated when Safari starts, but are still not updated.


Safari 15 does write tab/window changes to ~/Library/Containers/Safari/Data/Library/Saved Application State/com.apple.Safari/windows.plist1, but throws these away when Safari quits. If you try to save this folder and restore it before staring Safari, it hangs at startup. It appears that maybe they aren't checking before creating the folder at startup.

Nov 3, 2021 7:55 AM in response to CashewParrot

That must be frustrating. However, we are not Apple. We are Apple users, just like you. Please direct your thoughts to them directly. The following information may be a bit helpful. There have recently been many reports of a broad range of new problems on this support site about the latest release of Safari v15. It is included in the downloads for Big Sur and Catalina. If you are experiencing these problems, you can use another browser such as Firefox or Chrome and they will work for you until a newer version of Safari is released.

 

The release of Apple’s Monterey OS has Safari v15.1, so that may mean that Safari’s problems may have been addressed. Reloading your OS may also install the newer version of Safari. We will see.

Sep 29, 2021 7:05 AM in response to Derek Clegg

Why is this marked as fixed? This is a serious issue, basically what Safari 15 is doing on macOS 11.6 is this: you have your setup (tabs opened, saved group created etc), when you close it and reopen after a reboot it opens up with a missing step within groups creation (it will restore to last time you created a group and opened tabs, so basically currentSession-1 or the second-last session; sometimes it opens third-last session/state). So what I basically do I create another group with current tabs out of the groups and open random sites in the tabs "group" (not a saved group but your current tabs out of saved groups) and still when reopening after reboot I am one step/state behind the last created dummy last state. I can't get to just save my last session state.


Is a nightmare, and there is no solution except not closing safari and/or rebooting.

Feb 16, 2022 2:23 PM in response to Derek Clegg

I just migrated from a very old laptop running 10.13 High Sierra to a new laptop running 12.2 Monterey with Safari 15.3, and of course Safari doesn't reopen anything. Similar to other reports, if I boot into the recovery partition, turn off System Integrity Protection, reboot, and delete under ~/:


Library/Saved Application State/Safari

Library/Preferences/Safari

Library/Safari

Library/Containers/Safari


And then use ‘cp -pR’ to copy them over from my 10.13 High Sierra machine, Safari does reopen all the widows and tabs that were open on the old machine. But once I close Safari, nothing gets reopened. The setting to reopen windows from last time is set.


Is there really no solution?


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Safari 15 fails to restore last session. What can I do to fix it?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.