Captive Portal Problem

Hi everyone,
I know I’ve created several topics around the same issue, but this will (hopefully) be the last one.

I decided to auto-activate the free trial through the captive portal using HTML and JavaScript like this:

$(if trial == 'yes')
   <script>
        window.location.href = "$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)";
   </script>

It works fine on Android devices, but iPhones are problematic — they tend to aggressively cache the network state. The captive portal won’t reappear after the trial ends unless the user either:

Disconnects and reconnects to Wi-Fi

Or opens a browser manually

This behavior doesn’t happen on Android.

So now I’m looking for a workaround specifically for iPhones — maybe something that forces them to realize the network has changed. I’m wondering if using different subnets or VLANs might help trick the system into showing the captive portal again.

Any ideas?

do you have api.json in your hot spot file directory?