Forum Discussion
rajb
Feb 14, 2023Nimbostratus
Trying to find a way to delete cookie with a domain name using irule
Hello, I'm trying to delete cookie that have a domain name set. For example in the below pciture, there are cookies with domain name reddit, let's say I'd like to delete it with an irule ...
Paulius
MVP
rajb I believe the following iRule would work for you but please keep in mind that when you compare "GuysOnlineFilter" text it must be that exact text string, so It has to have those capitalized letters otherwise it will not match and it will do nothing. I recommend testing this in a lab evironment or on a test virtual server to ensure it is working as expected before applying to a production virtual server.
when HTTP_REQUEST priority 500 {
foreach a_cookie [HTTP::cookie names] {
set CookieDomain [HTTP::cookie domain ${a_cookie}]
if { ${a_cookie} == "GuysOnlineFilter" } {
if { [HTTP::cookie domain ${CookieDomain}] contains ".sq.org" } {
log local0. "it's working"
HTTP::cookie remove ${a_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