It depends on captive portal AP. Most of captive portal need to re-authenticate every several hours( or minutes), seems there is no way to avoid.