A self-consistent general relativistic configuration describing a finite cross-section magnetic flux tube is constructed. The cosmic solenoid is modeled by an elastic superconductive surface which separates the Melvin core from the surrounding flat conic structure. We show that a given amount $Phi$ of magnetic flux cannot be confined within a cosmic solenoid of circumferential radius smaller than $frac{sqrt{3G}}{2pi c^2}Phi$ without creating a conic singularity. Gauss-Codazzi matching conditions are derived by means of a self-consistent action. The source term, representing the surface currents, is sandwiched between internal and external gravitational surface terms. Surface superconductivity is realized by means of a Higgs scalar minimally coupled to projective electromagnetism. Trading the magnetic London phase for a dual electric surface vector potential, the generalized quantization condition reads: $e/{hc} Phi + 1/e Q=n$ with $Q$ denoting some dual electric charge, thereby allowing for a non-trivial Aharonov-Bohm effect. Our conclusions persist for dilaton gravity provided the dilaton coupling is sub-critical.