Forum Discussion
Deb_Allen_18
Jun 30, 2006Historic F5 Account
It actually looks like the basic rule logic is good (simple enough!), but the logging is picking up some random header info instead of the actual cookie values, and the selected pool also won't be known until the LB_SELECTED event.
So let's clean up the test as citizen elah suggested, add an LB_SELECTED event, grab the server-set cookie values, and test again:
when HTTP_RESPONSE {
if { [HTTP::header exists Set-Cookie] } {
log "If: server is setting these cookies: [HTTP::header Set-Cookie]"
}
}
when HTTP_REQUEST {
log "Current pool is [LB::server pool]"
if {[HTTP::cookie exists username]} {
log "If: username cookie from client, contents are: [HTTP::cookie username]"
use pool login1
} else {
log "Else: No username cookie from client"
use pool main
}
}
when LB_SELECTED {
log "Selected pool is [LB::server pool]"
}
Post back with more info if you run into further trouble.
HTH
/deb