Forum Discussion
HyperSl4ck3r_16
Nimbostratus
Sep 11, 2014Getting cookie value and using switch
Greetings,
I am trying to write an iRule that provides the client with a cookie that we can use to dictate behavior and possibly redirect the user if needed. This is going to be used so we can ensur...
What_Lies_Bene1
Cirrostratus
Sep 12, 2014Think I missed something;
when HTTP_REQUEST {
if { not [HTTP::cookie exists "Data_Locale"] } {
set need_cookie 1 }
else {
set cookie_local [HTTP::cookie value "Data_Locale"]
switch $cookie_local {
"www1" {
set need_cookie 0 }
}
}
}
when HTTP_RESPONSE {
switch $need_cookie {
"0" {
HTTP::cookie expires "Data_Locale" 1200 relative }
"1" {
HTTP::cookie insert name "Data_Locale" value "www1" }
}
}
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