Forum Discussion
iRule check for user-agent and set cookie
Hi htuyela, you syntax in the if looks wrong (sorry, i have not bigip close to me to try). the curly brace is closed before the second part of the condition in the if and you cannot test multiple options in the same condition, and the square bracket need to be closed for the string tolower function:
if {([string tolower [HTTP::header User-Agent]] contains "MSIE6" or "MSIE7" or "MSIE8"}) and (not [HTTP::cookie] exists "test")}
it should be like this
if { ([string tolower [HTTP::header User-Agent]] contains "MSIE6"]) and (not [HTTP::cookie] exists "test")}
if you want to test multiple options for the brworser, then i would recommend you to test the existence of the cookie first, and then iterate with a "switch" command, the browser types.
Does that make sense ?
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