Forum Discussion
Robert_47833
Altostratus
Jul 28, 2011how to insert cookie and persist to it
Hi,dear irule
I have a pool cjj which has 10 members ,ration is the load blance method
I need to insert cookie and persist with cookie ,
for example client1 ----->VS---->pool membe...
The_Bhattman
Nimbostratus
Aug 01, 2011Hi Jucao,
Good to hear that the cycles came down.
I don't have syntax for item 2 but I suppose it would be somewhat similar to item 1 code
The following is untested iRule.
when HTTP_REQUEST timing on {
set uri [string tolower [HTTP::uri]]
if {[class match $uri starts_with gen3abURLs_SRWD29] } {
if {[HTTP::cookie value_cookie] ne "" } {
pool cjjlb member $value_cookie
}
}
}
when LB_SELECTED {
set lbvalue "[LB::server_addr] [LB::server port]"
when HTTP_RESPONSE {
if {$lbvalue ne "" } {
HTTP::cookie insert name value_cookie value $lbvalue path "/"
}
}
I hope this helps
Bhattman