Forum Discussion
iiifa
Jan 12, 2022Nimbostratus
irule to remove all cookies
Hello,
we are testing an irule to remove all cookie from the client browser after an idle time, the cookie for TCP isn't what we are looking for rather than the actual cookie sent to the server.
any suggestion on how to achieve this, if I inserted a cookie manually I want the irule to delete it after I refresh the page.
we are testing this on BIG-IP LTM
?irule example :
when HTTP_REQUEST {
}
when HTTP_RESPONSE {
set cookieNames [HTTP::cookie names] #array of cookies
foreach aCookie $cookieNames { #adding the cookies to the array in a varaible aCookie
HTTP::cookie remove $aCookie #removing the virable
}
}
Something like this:
when HTTP_REQUEST { set request_cookies [HTTP::cookie names] } when HTTP_RESPONSE { foreach a_cookie $request_cookies { log local0. "Remove cookie: $a_cookie" HTTP::header insert Set-Cookie "$a_cookie=deleted;expires=Thu, 01-Jan-1970 00:00:10 GMT;path=/" } }
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