Forum Discussion
gbbaus_104974
Sep 11, 2011Historic F5 Account
Set-Cookie in Response, based on Requested URI
Hi Guys
I am trying to set a cookie in a HTTP_RESPONSE, but only when the HTTP_REQUEST is to a specific HTTP::uri
To set a cookie on all http responses is easy, for example:
when HTTP_RESPONSE {
HTTP::cookie insert name "Cookie_Name" value "ClientDetectedtrue"
}
BUT, how do I only set the response cookie on one specific response.
I wanted to do something like ..
when HTTP_RESPONSE{
if {[[HTTP::path] equals "/my.policy"]} {
HTTP::cookie insert name "Cookie_Name" value "ClientDetectedtrue"
}
}
BUT I cannot use the HTTP::path in a HTTP_RESPONSE.
Any ideas on hoe to selectively send a Set-Cookie, in only one specific response within a conversation ?
Thanks
Gary
- nitassEmployee
[root@Edelweiss:Active] config b virtual bar list
if {[string tolower [HTTP::uri]] equals "/my.policy"} {
when HTTP_RESPONSE {
[root@Edelweiss:Active] config curl -I http://172.28.17.17/my.policy
- gbbaus_104974Historic F5 AccountThank you -- does exactly what I need
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