Forum Discussion
Robert_47833
Apr 21, 2011Altostratus
question in http::cookie secure
when HTTP_RESPONSE
{
set myValues [HTTP::cookie names]
foreach mycookie $myValues
{
if {$mycookie == "cjj_INFO"}
{
Do nothing.
}
if {$mycookie == "cjj_SESS"}
{
Do nothing.
}
else {
HTTP::cookie secure $mycookie enable
}
}
}
If there is a http response include cjj_INFO and other cookie like,cjj_test,will they be set secure flag with respect to this irule
Because I don't know if I didn't set action or statement ,what will happen to the traffic?
Can some one help me?
Thanks very much
5 Replies
Sort By
- >I didn't set action or statement ,what will happen to the traffic?
when HTTP_RESPONSE { foreach myCookie [HTTP::cookie names] { if {not ($myCookie equals "cjj_INFO" or $myCookie equals "cjj_SESS")} { HTTP::cookie secure $myCookie enable } } }
- Hello jucao,
when HTTP_RESPONSE { set mycookienames [HTTP::cookie names] foreach cookie $mycookienames if !{ $mycookienames contains "cjj_INFO" or "cjj_SESS" } { HTTP::cookie secure $mycookienames enable } }
- oh,thanks nitass ,naladar
- >the cjj_info will be set a secure flag in the second if statement,right?
- I think it would be simpler to use a switch on the cookie value:
when HTTP_RESPONSE { foreach mycookie [HTTP::cookie names] { switch $mycookie { "cjj_INFO" - "cjj_SESS" { Do nothing. } default { HTTP::cookie secure $mycookie enable } } } }
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