Forum Discussion
eneR_159774
Nimbostratus
Dec 04, 2014Delete all Cookies if var x = true
Hello guys!
I have a question regarding my extreme "huge" 😉 irule.
What is my goal?
Check if there are enough members in the "serverPool" >1 If not -> switch over to another "backupServ...
- Dec 04, 2014
To delete all cookies you need something like this:
set cookieNames [HTTP::cookie names] foreach aCookie $cookieNames { HTTP::cookie remove $aCookie }
eneR
Cirrostratus
Dec 05, 2014when HTTP_REQUEST {
set VSPool [LB::server pool]
if { [active_members $VSPool] < 1 } {
log local0. "blabla..."
if { [HTTP::cookie exists "cookiename"]}{
set deleteCookie "1"
}
pool backupPool
}
}
when HTTP_RESPONSE {
if { $deleteCookie == 1}{
log local0. "blabla.."
HTTP::cookie remove "cookiename"
unset deleteCookie
}
}
Found some wrong braces by my own höhö.
Now it should work.
Another Question: What is better / faster -> to unset the deleteCookie var or to set it on "0" for example?! 😮
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