Implemented session restore.