Store app session on terminate.