Forum Discussion
Remove cookie with spaces in name
All,
I have a situation where a team member accidently dropped a cookie on our site with spaces / blanks in the name. This caused ASM to block pages from user browser requests with the cookie. As a work a around, I disabled RFC cookie checking, so we're good there. Now the web team wants the cookie deleted (expired).
I found an irule that should work on the response event, and I think it should work. Logging the progress of the irule shows that the http::cookie exists test is not catching the space embedded cookie.
when HTTP_RESPONSE {
log local0. "Now looking for cookie to kill"
if {[HTTP::cookie exists " kill this cookie"] }{
log local0. "cookie found"
HTTP::cookie remove " kill this cookie"
HTTP::header insert Set-Cookie " kill this cookie=deleted;secure;expires=Thu, 01 Jan 1970 00:00:00 GMT"
}
}
Does this need to be formatted differently or is it a limitation of the function? Any thought or ideas are appreciated.
Thanks,
Mike4 Replies
- JG
Cumulonimbus
Is the backend app server still issuing the bad cookie?
Hi Nova,
the
command should be able to catch a cookie name containing whitespaces (just verified this behavior on TMOS 12.1).[HTTP::cookie exists]If the problem still persist, then it could be a problem of CASE-sensitivity. So please verify if you're using the correct CASE within your iRule.
Cheers, Kai
- Nova_201357
Altocumulus
Thanks for the replies.
The iRule is working, my testing was flawed. So it's all good now.
Thanks, Mike
You're welcome! ;-)
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
