Hello,
I stumbled upon this in the following wiki page http://wiki.mikrotik.com/wiki/Manual:Customizing_Hotspot#List_of_available_variables and I was a little bit confused as to where this code would need to be placed:
iOS popup checker override
To work around iOS7 for iPhone login page detection, you can check for it’s specific user agent, and return SUCCESS, so that iPhone doesn’t pop up the login page. This is useful for setups where you use Cookies. Since the iPhone popup login window doesn’t support Cookies, you might want to force users to open Safari for logging in. To achieve this, we will return “SUCCESS” only to the login page checker service, but show normal login for people opening Safari.
$(if user-agent == CaptiveNetworkSupport)
SuccessSuccess
$(else)
---- regular content of rlogin.html page ----
$(endif)
\
\
Does the aforementioned code need to be placed into the login page of the hotspot? Currently we are utilizing the alternative with creating wall garden lists, but sometimes that doesn't work. Most Apple device users always keep up to date with the newest versions of IOS and so I thought this might be a better way to do it instead of doing all those wall garden list rules, however I do not know where this code would need to be placed.
Any sollution yet to your problem? I too have the same question as where to enter the code
Thanks in advance
No solution on my end as of yet.
Yes, all of those are supposed to be part of the HTML files of the hotspot. RouterOS pre-processes the recognized HTML file names (“login.html”, etc.) and gives out the post-processed variant to the browser.
Edit: So I see it goes into the rlogin.html page. Do I still need the walled garden rules or what? We are having too many people needing to get redirected through Safari for this to work and also people keep claiming that the login page prompts up after their Iphone comes back up from sleep mode…
read the manual carefully
http://wiki.mikrotik.com/wiki/Manual:Customizing_Hotspot#iOS_popup_checker_override
it’s clearly shows to put the code in rlogin.html
also it’s working for me
Please confirm that putting this in “rlogin.html” fixes the issue. I see many people having this issue, maybe we need to emphasize this more.
yes please do further investigation
this works sometimes but also gives random problems
I agree, I’ve even tried to ‘tweak things’.. see below code, set some static dns, added some items in WalledG. It works better than before, but every damned IOS phone/version do what he pleases and we stay in unpredictable zone 
$(if user-agent == CaptiveNetworkSupport)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>
$(elseif user-agent == 'CaptiveNetworkSupport')
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>
$(elseif user-agent == 'CaptiveNetworkSupport/1.0 wispr')
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>
$(else)
$(if http-status == 302)Hotspot login required$(endif)
$(if http-header == "Location")$(link-redirect)$(endif)
..CUT..
$(endif)
Okay I will give this a shot. But my primary question relating back to this rlogin.html code is whether or not it will automatically launch the captive portal or not? Or will the user still have to be redirected to an open http site?
Has anyone been able to find a stable fix for this?
We have tried modifying the rlogin.html but it also only works sometimes for us.