Forum Discussion
Robert_47833
Dec 21, 2011Altostratus
how to use foreach
when HTTP_RESPONSE {
set cjj [HTTP::cookie names]
foreach cjjcookie $cjj {
if {$cjjcookie == "how to add 4 cookie name here"
}
{ Do nothing.
}
else {
...
nitass
Dec 21, 2011Employee
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b pool foo list
pool foo {
members 200.200.200.101:80 {}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_RESPONSE {
foreach cjjcookie [HTTP::cookie names] {
if {[class match -- $cjjcookie equals unsecure_cookie]} {
Do nothing.
} else {
HTTP::cookie secure $cjjcookie enable
}
}
}
}
[root@ve1023:Active] config b class unsecure_cookie list
class unsecure_cookie {
{
"cookie1"
"cookie2"
"cookie3"
"cookie4"
}
}
[root@ve1023:Active] config curl -I http://200.200.200.101
HTTP/1.1 200 OK
Date: Wed, 21 Dec 2011 07:18:11 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
ETag: "4183e4-3e-9c564780"
Accept-Ranges: bytes
Content-Length: 62
Set-Cookie: cookie1=1111; path=/
Set-Cookie: cookie2=2222; path=/
Set-Cookie: cookie3=3333; path=/
Set-Cookie: cookie4=4444; path=/
Set-Cookie: cookie5=5555; path=/
Connection: close
Content-Type: text/html; charset=UTF-8
[root@ve1023:Active] config curl -I http://172.28.19.79
HTTP/1.1 200 OK
Date: Wed, 21 Dec 2011 07:18:17 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
ETag: "4183e4-3e-9c564780"
Accept-Ranges: bytes
Content-Length: 62
Set-Cookie: cookie1=1111; path=/
Set-Cookie: cookie2=2222; path=/
Set-Cookie: cookie3=3333; path=/
Set-Cookie: cookie4=4444; path=/
Set-Cookie: cookie5=5555;secure; path=/
Connection: close
Content-Type: text/html; charset=UTF-8
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