Forum Discussion
Mark_22062
Nimbostratus
Nov 12, 2014ASM Custom Response Page
Hi there,
I am using a custom response page for ASM, as part of that I want to clear some troublesome persistent cookies that are triggering alerts.
I've got the following setup in the response a...
Thomas_Schocka1
Altocumulus
Nov 13, 2014Hi Mark,
I believe you could use an iRule to do it, by first setting a variable that indicates that it needs to 'unset cookies', and then inserting the cookies in the HTTP_RESPONSE_RELEASE event. I'm not sure in which ASM event you'd be setting the 'need_to_unset_cookies' variable to 1, but once you found it, try something like this:
when HTTP_RESPONSE_RELEASE {
if { $need_to_unset_cookies == 1 } {
List the cookies
set cookies [HTTP::header values "Set-Cookie"]
Remove existing Set-Cookie headers
HTTP::header remove "Set-Cookie"
Run through the list, reinserting only those you want
foreach cookie $cookies {
if { !($cookie contains "___utmvc") } {
HTTP::header insert "Set-Cookie" $cookie
}
}
Insert your custom version of the cookies you wanted to change
HTTP::header insert "Set-Cookie" "___utmvc=deleted; domain=.foo.bar; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"
}
}
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
