Forum Discussion
elito_26780
Nimbostratus
May 01, 2007Glocal persistency with cookie
I found a case study that shows how to implement global cookie persistency with GTM. Here it is: http://www.f5.com/solutions/success/pdfs/casestudy_irule.pdf
This is the suggested code to do the job:
when HTTP_REQUEST {
if { [HTTP::cookie exists "my_cookie"] {
HTTP::cookie decrypt "my_cookie" "iggus99!"
set vipid [lindex [HTTP::cookie my_cookie] 0]
set poolid [lindex [HTTP::cookie my_cookie] 1]
set serverid [lindex [HTTP::cookie my_cookie] 2]
set portid [lindex [HTTP::cookie my_cookie] 3]
if { [catch { use pool $poolid member $serverid $portid }] } {
log "$serverid:$portid not local, redirecting to https://$vipid/[HTTP::uri]/"
redirect to "https://$vipid/[HTTP::uri]/"
reject
return
}
else {
use pool $poolid member $serverid $portid
}
}
}
when HTTP_RESPONSE {
HTTP::cookie insert name my_cookie value [concat [virtual name] [LB::server]]
HTTP::cookie encrypt "my_cookie" "iggus99!"
}
What I miss here is a check whether the original VS is up. Otherwise I might sending the client to dead VS. How can I do it with iRules?
5 Replies
Sort By
- JRahm
Admin
The rule was written to meet a requirement for clients who could not be persisted within the application (hardcoded 1minute refresh utilizing name only) The 3dns was configured to round robin, so client was redirected nearly every minute for data refresh, which caused real problems since the SLA on data sync on the backend was 5 minutes. - elito_26780
Nimbostratus
Thanks! - JRahm
Admin
when you say global setup are you indicating usage of GTM? GTM can be configured to monitor virtual server health via active monitors, via the iquery communication to an LTM, or both. I haven't done much with GTM in regards to iRules, but I do know the options here are limited because there really isn't a data path involved. - elito_26780
Nimbostratus
May be it's a wrong place to ask about GTM , but I'll appreciate your answer. - JRahm
Admin
This isn't the right forum, but since the thread has already been started...
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