Split saveSession method to save only on terminate