Forum Discussion
Removing Cookies from Client: Nothing seems to work....
I cannot get any of the cookie commands to remove cookies from the client. I want to have the F5 tell the client to remove cookies if they hit a certain URI. Here is what I have tried so far. None of it worked. I am not seeing any cookie response headers coming back
First try....
when HTTP_REQUEST {
set cookies [HTTP::cookie names]
some other stuff blah blah blah
if {[HTTP::path] matches "/delete-my-cookies"} {
set deletecookies 1
return
}
}
when HTTP_RESPONSE {
if { deletecookies == 1 } {
foreach cookie $cookies {
HTTP::cookie remove $cookie
}
HTTP::respond 200 content "OK!"
}
}
Second try....
when HTTP_REQUEST {
set cookies [HTTP::cookie names]
some other stuff blah blah blah
if {[HTTP::path] matches "/delete-my-cookies"} {
set deletecookies 1
return
}
}
when HTTP_RESPONSE {
HTTP::cookie remove "cookie1"
HTTP::cookie remove "cookie2"
etc, etc
HTTP::respond 200 content "OK!"
}
Third Try....
when HTTP_REQUEST {
set cookies [HTTP::cookie names]
some other stuff blah blah blah
if {[HTTP::path] matches "/delete-my-cookies"} {
set deletecookies 1
return
}
}
when HTTP_RESPONSE {
HTTP::cookie insert name "cookie1" value "test_value" domain ".slce006.com"
HTTP::cookie expires "cookie1" 1 absolute
HTTP::cookie insert name "cookie2" value "test_value" domain ".slce006.com"
HTTP::cookie expires "cookie1" 2 absolute
HTTP::respond 200 content "OK!"
}
Any ideas? Basically I want the client to scrub all session cookies it has when it hits this URL so the client browser expires all cookies.
On BigIP Version 11.6
- VernonWellsEmployee
simply removes theHTTP::cookie remove
header from the request or response headers (depending on the context in which it is run).Set-Cookie
To force a client to remove a cookie, you must re-set the cookie with an expires time that has already elapsed. See, for example, this DevCentral discussion:
and
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