Forum Discussion
Robert_47833
Altostratus
Oct 30, 2012small question in "persist"
virtual test {
snat automap
destination 1.1.1.1:http
ip protocol tcp
rules test-irule
profiles {
http {}
oneconnect {}
tcp { ...
hoolio
Cirrostratus
Oct 30, 2012I think you'd need to add a cookie persistence profile to use any of the persist cookie iRule commands. The simplest solution from a BIG-IP perspective would be to use cookie insert so BIG-IP doesn't need to track any sessions in its memory. If it really isn't an option to add a persistence profile, you could use persist uie from an iRule:
from: https://devcentral.f5.com/wiki/iRules.Weblogic_JSessionID_Persistence.ashx
when HTTP_REQUEST {
Log details for the request
set log_prefix "[IP::client_addr]:[TCP::client_port]"
log local0. "$log_prefix: Request to [HTTP::uri] with cookie: [HTTP::cookie value my_cookie]"
Check if there is a my_cookie cookie
if { [HTTP::cookie "my_cookie"] ne "" }{
Persist off of the cookie value with a timeout of 1 hour (3600 seconds)
persist uie [string tolower [HTTP::cookie "my_cookie"]] 3600
Log that we're using the cookie value for persistence and the persistence key if it exists.
log local0. "$log_prefix: Used persistence record from cookie. Existing key? [persist lookup uie [string tolower [HTTP::cookie "my_cookie"]]]"
}
}
when HTTP_RESPONSE {
Check if there is a my_cookie cookie in the response
if { [HTTP::cookie "my_cookie"] ne "" }{
Persist off of the cookie value with a timeout of 1 hour (3600 seconds)
persist add uie [string tolower [HTTP::cookie "my_cookie"]] 3600
log local0. "$log_prefix: Added persistence record from cookie: [persist lookup uie [string tolower [HTTP::cookie "my_cookie"]]]"
}
}
Aaron
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