Added support for saving sessions.