save history and session