sundogbrew
Jan 23, 2017Altocumulus
Cookie persistence Irule
Hey Guys, I am having a similar problem to that posted in this link https://devcentral.f5.com/questions/universal-persistence-irule-does-not-appear-to-be-working-50007
So I am working on getting a window to test these Irules written in there. My question is how would I insert a timeout value into those rules?
iRule 1: Creating multiple UIE table entries for each of the cookies
when HTTP_REQUEST {
if { [HTTP::cookie value "JSESSIONID"] ne "" } then {
persist uie [HTTP::cookie value "JSESSIONID"]
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] } then {
foreach cookie_value [lsearch -inline -all -glob [HTTP::header values "Set-Cookie"] "JSESSIONID=*"] {
persist add uie [findstr $cookie_value "=" 1 ";"]
}
}
}
iRule 2: De-duplicating redundant cookies (according to RFC 6265) before executing [persist uie]
when HTTP_REQUEST {
if { [HTTP::cookie value "JSESSIONID"] ne "" } then {
persist uie [HTTP::cookie value "JSESSIONID"]
}
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] } then {
foreach cookie_value [lsearch -inline -all -glob [HTTP::header values "Set-Cookie"] "JSESSIONID=*"] {
HTTP::cookie remove "JSESSIONID"
}
HTTP::header insert "Set-Cookie" $cookie_value
persist add uie [HTTP::cookie value "JSESSIONID"]
}
}
Thanks as always! Joe