This is inside another if condition inside for loop. Only when there is no session available for port and when global is enabled, the session needs to be created. When enable is set to false when there is no session on port already it can be skipped.