Microfluidic devices comprising semi-permeable flat membranes