Forum Discussion
Mobile iRule help to stay on MainSite
Some quick thoughts:
-
If you set a variable in the HTTP_REQUEST event, you should look for in the HTTP_RESPONSE event with an [info exists ] command. Example:
when HTTP_RESPONSE { if { [info exists stop_mobi_cookie] } { ... } }
-
Using the above logic, you should only need to set/create the variable in the "yes" branch of the URI::query evaluation (to a value of 1). If you need the ability to switch back and forth after the user has the cookie, you can optionally add in the zero value as you've done, and then evaluate that in HTTP_RESPONSE.
-
You shouldn't need the 'set stop_mobi_cookie 1` expression in the "1" clause of the cookie switch expression, because the cookie already equals 1. At best you probably just need a **return** statement.
-
If you don't need to be able to switch back and forth after the user has the stop_mobi cookie, then your iRule can be a lot simpler - just checking for the existence of the cookie or the existence and value of the query string.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com