Forum Discussion
Robert_47833
Altostratus
Jul 29, 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...
Robert_47833
Altostratus
Aug 01, 2011Hi,Bhattman
1:can u tell me why item1 has improved
set rand [expr { rand() }]
I have changed it as
set BigipABurl_cookie ""
if {[class match $uri starts_with gen3abURLs_SRWD29]} {
set rand [expr { rand() }]
switch -glob [HTTP::cookie BigipABurl_cookie] {
"1" {
pool SRWD29-G3-BRX
return
}
"2" {
pool SRWD29-BROWSE
return
}
default {
if { $rand <0.2 } {
pool SRWD29-G3-BRX
set BigipABurl_cookie 1
return
}
else {
pool SRWD29-BROWSE
set BigipABurl_cookie 2
return
}
}
}
}
when HTTP_RESPONSE {
if {$BigipABurl_cookie ne "" } {
HTTP::cookie insert name BigipABurl_cookie value $BigipABurl_cookie path "/"
}
2:I have changed it as:
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
}
else {
pool cjjb
}
}
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 "/"
}
}
for this method,I have a question
we didn't define $value_cookie
also I want to know when n variable will change during the connection
for example ,we define $value_cookie ,and it get a value in http_request,we can find this value in http_response
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects