Forum Discussion
abewu_915
Nimbostratus
Nov 15, 2007iRule not working when HTTP cookie header exceeds certain length?
Hello there,
I've got a simple iRule that
rewrites the "Cookie Insert" cookie domains by chopping off the first
part before the period (so the cookie domain "www.mydomain.com" bec...
abewu_915
Nimbostratus
Nov 20, 2007The new iRule worked great! Thank you for your help! For reference, here is the new iRule:
when HTTP_REQUEST {
Set the Cookie Name automatically based on the server pool name
set cookie_name "BIGipServer[LB::server pool]"
log "cookie_name $cookie_name"
Find the correct cookie domain dynamically based on the host in the URL.
set host [HTTP::host]
Use the substring from the first dot to the end of the string.
set cookie_domain [findstr $host "."]
Set the Cookie Domain for this site
log "cookie domain is $cookie_domain"
}
when HTTP_RESPONSE {
We need to rewrite the cookies used by the application, because they have the wrong domain.
if {[HTTP::cookie count] > 0}{
if {[HTTP::cookie exists "$cookie_name"]}{
HTTP::cookie domain $cookie_name $cookie_domain
log "rewriting cookie domain: cookie=$cookie_name, domain=$cookie_domain"
}
}
}
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
