Looks like you already wrote `endSession`. Does that do the job here?