Forum Discussion
amebiz_142234
May 25, 2018Nimbostratus
irule pool selection based on dynamic cookie value
Hi, my scenario: i want to select a pool based on a cookie value - that works as aspected when_HTTP_REQUEST {
if { [HTTP::cookie exists "myCookie"] } {
switch -glob [HTTP::cookie value "myCook...
amebiz_142234
Jun 06, 2018Nimbostratus
there is a way to add a cookie in a redirect. also a cool way to handle that
when_HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/foo/" } {
set cookie [format "%s=%s; path=/; domain=%s" "cookie" "foo" ".foobar.com"]
HTTP::respond 301 Location "/foo" "Set-Cookie" $cookie
}
if { [string tolower [HTTP::uri]] equals "/bar/" } {
set cookie [format "%s=%s; path=/; domain=%s" "cookie" "bar" ".foobar.com"]
HTTP::respond 301 Location "/bar" "Set-Cookie" $cookie
}
}
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