htuytela_37346
Dec 12, 2013Nimbostratus
iRule check for user-agent and set cookie
Hi,
I'm trying to get an iRule to work that checks on User-Agent, being IE6,7,8 and setting a cookie. Basically, I want those browsers to be redirected to another page, and set a cookie. When the user returns, he should not be redirected anymore. That is why I'm setting this cookie. This is what I have, although I'm getting "line 1: [wrong args] [when HTTP_REQUEST { " here. All help is appreciated. A side question, how can I set the expiry time for that cookie ?
` when HTTP_REQUEST {
if {([string tolower [HTTP::header User-Agent]] contains "MSIE6" or "MSIE7" or "MSIE8"}) and (not [HTTP::cookie] exists "test")}{
HTTP::redirect "https://test-lab.foo.com/CG510_APR_RedirecttestURL/"
HTTP::cookie insert "test"
else pool site-10.130.14.98_29710 }`
Thanks,
Hans