ST_Wong
Aug 18, 2015Cirrus
Cannot insert cookie
Hi all,
I tried to do URI based pool selection on first request. Then sequence requests will be directed to the same pool even the URI doesn't match. I use simple codes like following, however, the cookie can't be inserted. We're using outdated 9.4.8... Would anyone please help?
Thanks and rgds
/ST Wong
when HTTP_REQUEST {
set myCheck 0
if {[HTTP::cookie exists "X-DWSpool"]} {
pool test1-pool
} else {
switch -glob [string tolower [HTTP::uri]] {
"/test1/*" {
pool test1-pool
set myCheck 1
}
"/test2/*" {
pool test2-pool
}
default {
pool default-pool
}
}
}
}
when HTTP_RESPONSE {
if ($myCheck) {
HTTP::cookie insert name "X-DWSpool" value "foo" path /
}
}