Forum Discussion
jamesdris
Nimbostratus
Nov 02, 2015making changes to cookie
I have a VIP on which cookie persistence is enabled.
The cookie header contains a lot of other cookies that my browser passes. Is it possible to trim some of those cookies and pass only the desired o...
Brad_Parker_139
Nacreous
Nov 02, 2015This should remove all cookies except for the "test-cookie" you want.
when HTTP_REQUEST {
set sessionCookies [ HTTP::cookie names ]
foreach mycookie $sessionCookies {
if { not ($mycookie equals "test-cookie") }{
HTTP::cookie remove $mycookie
}
}
}
- Brad_Parker_139Nov 02, 2015
Nacreous
Also, if you want to have a list of allowed cookies, create a data group containing that list named "allowedCookies_dg" and use an iRule like this. when HTTP_REQUEST { set sessionCookies [ HTTP::cookie names ] foreach mycookie $sessionCookies { if { not ( [class match $mycookie equals "allowedCookie_dg"]) }{ HTTP::cookie remove $mycookie } } }
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