Forum Discussion
East_Coast_1151
Nimbostratus
Oct 09, 2013How to delete cookies with random names?
Hello,
I have a Web app that uses random cookie names that appear at different Web pages. I want to flush these cookies at logoff time.
Currently I am using the following irule.
Is there a more...
hoolio
Cirrostratus
Oct 10, 2013Make sure to unset logoff or set it to 0 if you're setting it in HTTP_REQUEST to avoid removing the cookies on subsequent requests on the same TCP connection:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/logoff.php" } {
set logoff 1
set incoming_cookies [HTTP::cookie names]
} else {
set logoff 0
}
}
when HTTP_RESPONSE {
if { $logoff==0 } {
foreach x $incoming_cookies {
HTTP::header insert Set-Cookie "$x=deleted; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"
}
}
}
Aaron
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