commit session before closing it