Forum Discussion
Julio_Navarro
Jan 09, 2019Cirrostratus
iRule Switch/If/Else | using cookie name
Hello!
Question 1
I am looking for a way to use the "switch" option (instead of an if/else condition) when a certain cookie name is present.
For example:
switch [HTTP::cookie name] {
"Cook...
Dave_McCauley_3
Jan 10, 2019Cirrostratus
So you want to do a for loop on the list of cookies that the names gives you:
set cookies [HTTP::cookie names]
loop through each cookie by name in request
foreach aCookie $cookies {
do Stuff (tm) to $aCookie
switch $aCookie... or whatever you want to do
}
You can do the string tolower on a cookie name, but note that in your example it would never match because it would have to be all lower "jsesssionid"
Hope this points you in the right direction!
--D
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