In general, the answer is no. Under federal law, marijuana is a illegal Schedule 1 narcotic deemed to have a “high potential for abuse and no medical value”, Federal law does not distinguish between medical and recreational marijuana. Any form of the substance is illegal. Since airports, airspace, and airplanes all fall under federal jurisdiction, anyone found flying with medical marijuana is at risk of being detained, arrested, and prosecuted under federal law.
However, TSAs official policy has stated that they are not specifically looking for marijuana and if they do happen to find it in a routine search, it’s largely up to the individual TSA agent to decide how to respond.
You are allowed to fly in-state with medical marijuana provided that you have the right documentation for medical marijuana. It is completely illegal to take marijuana across state lines because it’s much easier to sell this way. Whether or not marijuana in that state is legal, it’s completely illegal to fly across state lines with marijuana. Marijuana should be fine to carry on a plane as long as you stay instate, but keep in mind that you will need the legal documentation to fly with marijuana, or you could end up in trouble.
No, you cannot fly anywhere with marijuana. Commercial airports and airlines are under Federal jurisdiction. Marijuana remains illegal under Federal law and the TSA does not respect local law. Where you are flying does not matter as the marijuana becomes illegal as soon as you enter a commercial airport. The TSA may just warn you, but they also could prosecute you.