Loading and saveing session state.