I changed the iRule to do the add in the response. According to the logs it's adding the correct value, but it's happening every time someone connects (which might be ok, I'm not sure). Unfortunately, the persistence still isn't working. The connections with the same uid are going to different servers.
I did verify that the iRule is applied to the persistence profile, so that part at least is correct.
Any ideas why it wouldn't be persisting? Is there anything else I might be missing?
Here's the current iRule I'm using:
when HTTP_REQUEST {
set fulluri [HTTP::uri]
set uid [findstr [HTTP::uri] "uid=" 5 "&"]
if { $uid != "" } {
log local0. "Set persist value to uid: $uid | $fulluri"
persist uie $uid
}
else {
log local0. "No uid found in HTTP REQUEST | $fulluri"
}
}
when HTTP_RESPONSE {
if { $uid != "" } {
log local0. "Adding persist value to table: $uid"
persist add uie $uid
}
}