Greetings,
I have used the iRule that I found on devcentral with good success in my lab but when trying to use real data I ran into a stumbling block.
original code
when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "sid"] and $add_persist } {
persist add uie [HTTP::cookie "sid"]
set add_persist 0
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "sid"] } {
persist uie [HTTP::cookie "sid"]
} else {
set jsess [findstr [HTTP::uri] "sid" 4 "?"]
if { $jsess != "" } {
persist uie $jsess
}
}
}
This works until the mobile devices go through proxy and the cookie can be appended with data we do not need. I was hoping to find a good way to has the cookie data. This is what I came up with but its not working.
when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "sid"] and $add_persist } {
persist add uie [findstr [HTTP::cookie] "sid" 4 ";"]
set add_persist 0
}
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "sid"] } {
persist uie [findstr [HTTP::cookie] "sid" 4 ";"]
} else {
set jsess [findstr [HTTP::uri] "sid" 4 "?"]
if { $jsess != "" } {
persist uie $jsess
}
}
}
this is an example of the appened value
Cookie: sid=fertLBH2OLMHXcfEjXukr; $Path=“/”; name=SCDRb11663f0101aa83e; $Path=“/”;