End session implementation