hI,I have worked out,but still need to confirm with u in some details
Can u have a look at the irule below
when HTTP_RESPONSE {
if { $stubhubA_cookie == 1 }{
HTTP::cookie insert name stubcjjA_cookie value 1 path "/"
HTTP::cookie expires "stubcjjA_cookie" "25920000" relative
}
if { $stubhubB_cookie == 1 }{
HTTP::cookie insert name stubhubB_cookie value 1 path "/"
HTTP::cookie expires "stubhubB_cookie" "25920000" relative
}
}
when HTTP_REQUEST {
set stubcjjA_cookie 0
set stubcjjB_cookie 0
if {[class match $uri starts_with gen3abURLs_SRWD29]} {
if {[HTTP::cookie value stubcjjA_cookie] == 1}{
pool SRWD29-G3-BRX
log local0. "BRX $stubcjjA_cookie PERSIST"
return
}
if {[HTTP::cookie value stubcjjB_cookie] == 1}{
pool SRWD29-BROWSE
log local0. "BRX $stubcjjB_cookie PERSIST"
return
}
if { rand() <0.2 } {
pool SRWD29-G3-BRX
set stubhubA_cookie 1
log local0. "BRX stubhubA_cookie $stubcjj_cookie "
} else {
pool SRWD29-BROWSE
set stubhubB_cookie 1
log local0. "BRS stubhubB_cookie $stubcjjB_cookie "
return
}
}
questiones:
1:when u mention session cookie ,it means when I close the broswer,the cookie will expire?
how to set cookie as session cookie or permanent cookie
2:in the HTTP_RESPONSE event,it will affect all the http response? if some traffic didn't have the cookie,what will irule do?